diff options
author | Explorer09 <explorer09@gmail.com> | 2023-08-26 16:56:06 +0800 |
---|---|---|
committer | cgzones <cgzones@googlemail.com> | 2023-08-29 21:47:56 +0200 |
commit | 25cb42f0e4be70f02dc094d81e033ba21ec18b27 (patch) | |
tree | 98bfff2502ecee0a09800f034cb960ad862db0b2 /linux/LinuxMachine.c | |
parent | 8ecdb75d74c393895c68be7a311db959b1f373e9 (diff) |
Rework ZramMeter and remove MeterClass.comprisedValues
The 'comprisedValues' boolean property unnecessarily complicates the
drawing algorithms of Bar meters and Graph meters. Since the only user
of 'comprisedValues' is ZramMeter, it is better to rework the meter so
that it no longer needs 'comprisedValues'.
The 'values[ZRAM_METER_UNCOMPRESSED]' now stores the difference between
uncompressed and compressed data size.
Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
Diffstat (limited to 'linux/LinuxMachine.c')
-rw-r--r-- | linux/LinuxMachine.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/linux/LinuxMachine.c b/linux/LinuxMachine.c index 21fd4bd1..5d2e67e9 100644 --- a/linux/LinuxMachine.c +++ b/linux/LinuxMachine.c @@ -337,6 +337,9 @@ static void LinuxMachine_scanZramInfo(LinuxMachine* this) { this->zram.totalZram = totalZram / 1024; this->zram.usedZramComp = usedZramComp / 1024; this->zram.usedZramOrig = usedZramOrig / 1024; + if (this->zram.usedZramComp > this->zram.usedZramOrig) { + this->zram.usedZramComp = this->zram.usedZramOrig; + } } static void LinuxMachine_scanZfsArcstats(LinuxMachine* this) { |