summaryrefslogtreecommitdiffstats
path: root/CPUMeter.c
diff options
context:
space:
mode:
authorBenny Baumann <BenBE@geshi.org>2020-09-07 12:07:08 +0200
committercgzones <cgzones@googlemail.com>2020-09-24 18:06:36 +0200
commitebcf92464353d44c1d01b5afd286314415a66c96 (patch)
tree57660b23e16229a107b19f592dac25dd9a6e4c0c /CPUMeter.c
parentd0d3deb73c9f185985e62b6b6bda76a4d324e9e8 (diff)
Use threshold for display of guest/steal/irq meters
Diffstat (limited to 'CPUMeter.c')
-rw-r--r--CPUMeter.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/CPUMeter.c b/CPUMeter.c
index 99586784..62c9971b 100644
--- a/CPUMeter.c
+++ b/CPUMeter.c
@@ -83,12 +83,12 @@ static void CPUMeter_display(Object* cast, RichString* out) {
xSnprintf(buffer, sizeof(buffer), "%5.1f%% ", this->values[CPU_METER_SOFTIRQ]);
RichString_append(out, CRT_colors[METER_TEXT], "si:");
RichString_append(out, CRT_colors[CPU_SOFTIRQ], buffer);
- if (this->values[CPU_METER_STEAL]) {
+ if (!isnan(this->values[CPU_METER_STEAL])) {
xSnprintf(buffer, sizeof(buffer), "%5.1f%% ", this->values[CPU_METER_STEAL]);
RichString_append(out, CRT_colors[METER_TEXT], "st:");
RichString_append(out, CRT_colors[CPU_STEAL], buffer);
}
- if (this->values[CPU_METER_GUEST]) {
+ if (!isnan(this->values[CPU_METER_GUEST])) {
xSnprintf(buffer, sizeof(buffer), "%5.1f%% ", this->values[CPU_METER_GUEST]);
RichString_append(out, CRT_colors[METER_TEXT], "gu:");
RichString_append(out, CRT_colors[CPU_GUEST], buffer);
@@ -103,7 +103,7 @@ static void CPUMeter_display(Object* cast, RichString* out) {
xSnprintf(buffer, sizeof(buffer), "%5.1f%% ", this->values[CPU_METER_NICE]);
RichString_append(out, CRT_colors[METER_TEXT], "low:");
RichString_append(out, CRT_colors[CPU_NICE_TEXT], buffer);
- if (this->values[CPU_METER_IRQ]) {
+ if (!isnan(this->values[CPU_METER_IRQ])) {
xSnprintf(buffer, sizeof(buffer), "%5.1f%% ", this->values[CPU_METER_IRQ]);
RichString_append(out, CRT_colors[METER_TEXT], "vir:");
RichString_append(out, CRT_colors[CPU_GUEST], buffer);

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