summaryrefslogtreecommitdiffstats
path: root/DiskIOMeter.c
diff options
context:
space:
mode:
authorBenny Baumann <BenBE@geshi.org>2021-10-30 10:57:14 +0200
committerBenny Baumann <BenBE@geshi.org>2021-10-30 10:57:14 +0200
commit2977414d540c9cb78baa3d7fc612fcb4d6ecc72f (patch)
treed5310d44404dd6248fc682d6bd5610683b2764e9 /DiskIOMeter.c
parent696f79fe5099d510fc6ecc6d1e2f0ab3ae29e04e (diff)
Discard stale information from DiskIO and NetworkIO meters
This ensures the initial read of the data is not misinterpreted as arbitrarily large values. Also this forces the maximum update interval between two subsequent reads to within 30s. Fixes #860
Diffstat (limited to 'DiskIOMeter.c')
-rw-r--r--DiskIOMeter.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/DiskIOMeter.c b/DiskIOMeter.c
index c5f14768..11fb791e 100644
--- a/DiskIOMeter.c
+++ b/DiskIOMeter.c
@@ -81,6 +81,12 @@ static void DiskIOMeter_updateValues(Meter* this) {
cached_msTimeSpend_total = data.totalMsTimeSpend;
}
+ if (passedTimeInMs > 30000) {
+ // Triggers for the first initialization and
+ // when there was a long time we did not collect updates
+ hasData = false;
+ }
+
this->values[0] = cached_utilisation_diff;
this->total = MAXIMUM(this->values[0], 100.0); /* fix total after (initial) spike */

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