diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2020-12-08 15:55:26 +0100 |
---|---|---|
committer | BenBE <BenBE@geshi.org> | 2020-12-08 23:09:35 +0100 |
commit | ded9c5d36332401bb8d5e33b6f72de188a42560d (patch) | |
tree | 54a59448134e34e9d6767d4e5af56dc2a3ca0508 /linux | |
parent | 2d231d77ca2e36147a91fa061924fb0ea880b90f (diff) |
PSI Meter: use constant width and only print ten-duration as bar
Diffstat (limited to 'linux')
-rw-r--r-- | linux/PressureStallMeter.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/linux/PressureStallMeter.c b/linux/PressureStallMeter.c index 91ac562b..7486968f 100644 --- a/linux/PressureStallMeter.c +++ b/linux/PressureStallMeter.c @@ -43,17 +43,21 @@ static void PressureStallMeter_updateValues(Meter* this, char* buffer, size_t le } Platform_getPressureStall(file, some, &this->values[0], &this->values[1], &this->values[2]); - xSnprintf(buffer, len, "%s %s %.2lf%% %.2lf%% %.2lf%%", some ? "some" : "full", file, this->values[0], this->values[1], this->values[2]); + + /* only print bar for ten (not sixty and threehundred), cause the sum is meaningless */ + this->curItems = 1; + + xSnprintf(buffer, len, "%s %s %5.2lf%% %5.2lf%% %5.2lf%%", some ? "some" : "full", file, this->values[0], this->values[1], this->values[2]); } static void PressureStallMeter_display(const Object* cast, RichString* out) { const Meter* this = (const Meter*)cast; char buffer[20]; - xSnprintf(buffer, sizeof(buffer), "%.2lf%% ", this->values[0]); + xSnprintf(buffer, sizeof(buffer), "%5.2lf%% ", this->values[0]); RichString_writeAscii(out, CRT_colors[PRESSURE_STALL_TEN], buffer); - xSnprintf(buffer, sizeof(buffer), "%.2lf%% ", this->values[1]); + xSnprintf(buffer, sizeof(buffer), "%5.2lf%% ", this->values[1]); RichString_appendAscii(out, CRT_colors[PRESSURE_STALL_SIXTY], buffer); - xSnprintf(buffer, sizeof(buffer), "%.2lf%% ", this->values[2]); + xSnprintf(buffer, sizeof(buffer), "%5.2lf%% ", this->values[2]); RichString_appendAscii(out, CRT_colors[PRESSURE_STALL_THREEHUNDRED], buffer); } |