I3status-rust: disk block: compute state broken since 8074b0bbade191c0ab31158e666efed0fa392f04

Created on 20 Sep 2020  路  7Comments  路  Source: greshake/i3status-rust

Hi,

the calculation when the alert triggers changed in commit 8074b0bbade191c0ab31158e666efed0fa392f04. It used to take a percentage. That was imo a much better behavior than the total that is taken now. And the size of the total does not seem to be taken in GB as the documentations suggest, but in the given unit of the block.

I was expecting an alert at 10/20 % of my 6TB hard drives. With the update all disks turned red and I am expected to have 20TB disk space left to get no alert.

Maybe you could reconsider that part of the change and restore the old behavior. I am myself a rust newbie and would try to have a go if you agree to revert that part of the change and provide me with reviews.

bug

All 7 comments

That does seem wrong. @jamesmcm do you get this too?

Could you please post your config @ObiWahn ?

Ideally we'd be able to use both absolute values and percentages, the tricky part is that if you set unit = "Percent" then _all_ the values are set to use percentages which is probably not what you want. That would fix the percentage alert though (but {used} etc. would show bytes).

I see two options, either assume to show in GB if using unit = "Percent" so at least the bytes issue is fixed, or add another field in the config for that.

My blocks look like this:

[[block]]
block = "disk_space"
path = "/mnt/system/backup"
alias = "backup"
info_type = "available"
unit = "TB"
interval = 20
warning = 20.0
alert = 10.0

df output:

/dev/sdc2                2,9T  1,3T  1,5T  46% /mnt/system/backup

Okay, I'll add an absolute_alerts boolean to set absolute values for the alerts and use percentages otherwise (regardless of the unit setting) for backwards compatibility.

@jamesmcm awesome! I was just about to suggest either that or appending % to trigger the percentage mode.

See #831

Also my config is:

[[block]]
block = "disk_space"
path = "/"
alias = "/"
info_type = "available"
unit = "GiB"
interval = 20
warning = 20.0
alert = 10.0
format = "{icon}{used}/{total} {unit} ({available}{unit} / {percentage} free)"

Works as expected! Thank you!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Nukesor picture Nukesor  路  5Comments

concatime picture concatime  路  4Comments

Rikorose picture Rikorose  路  5Comments

lovesegfault picture lovesegfault  路  7Comments

resingm picture resingm  路  5Comments