aboutsummaryrefslogtreecommitdiffstats
path: root/linux/PressureStallMeter.c
diff options
context:
space:
mode:
authorDaniel Lange <DLange@git.local>2021-01-11 20:43:28 +0100
committerDaniel Lange <DLange@git.local>2021-01-11 20:43:28 +0100
commit94123a215ba971baf4ad7e12cc479258ddb8600e (patch)
tree6f053d8e1ce754ab7104b7364be9754231ab84de /linux/PressureStallMeter.c
parent50cb99f0acecb15992f3d5610c02676a6c94f2a4 (diff)
parentc55320e9e2a8916e911bcd39ab37b79e3a7d03b2 (diff)
downloaddebian_htop-94123a215ba971baf4ad7e12cc479258ddb8600e.tar.gz
debian_htop-94123a215ba971baf4ad7e12cc479258ddb8600e.tar.bz2
debian_htop-94123a215ba971baf4ad7e12cc479258ddb8600e.zip
Update upstream source from tag 'upstream/3.0.5'
Update to upstream version '3.0.5' with Debian dir 10922042e094a59dc72f9c39ddd4bfd59c7a302c
Diffstat (limited to 'linux/PressureStallMeter.c')
-rw-r--r--linux/PressureStallMeter.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/linux/PressureStallMeter.c b/linux/PressureStallMeter.c
index 745068c..7486968 100644
--- a/linux/PressureStallMeter.c
+++ b/linux/PressureStallMeter.c
@@ -43,18 +43,22 @@ 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]);
- RichString_write(out, CRT_colors[PRESSURE_STALL_TEN], buffer);
- xSnprintf(buffer, sizeof(buffer), "%.2lf%% ", this->values[1]);
- RichString_append(out, CRT_colors[PRESSURE_STALL_SIXTY], buffer);
- xSnprintf(buffer, sizeof(buffer), "%.2lf%% ", this->values[2]);
- RichString_append(out, CRT_colors[PRESSURE_STALL_THREEHUNDRED], buffer);
+ xSnprintf(buffer, sizeof(buffer), "%5.2lf%% ", this->values[0]);
+ RichString_writeAscii(out, CRT_colors[PRESSURE_STALL_TEN], buffer);
+ xSnprintf(buffer, sizeof(buffer), "%5.2lf%% ", this->values[1]);
+ RichString_appendAscii(out, CRT_colors[PRESSURE_STALL_SIXTY], buffer);
+ xSnprintf(buffer, sizeof(buffer), "%5.2lf%% ", this->values[2]);
+ RichString_appendAscii(out, CRT_colors[PRESSURE_STALL_THREEHUNDRED], buffer);
}
const MeterClass PressureStallCPUSomeMeter_class = {

© 2014-2024 Faster IT GmbH | imprint | privacy policy