summaryrefslogtreecommitdiffstats
path: root/DiskIOMeter.c
diff options
context:
space:
mode:
authorNathan Scott <nathans@redhat.com>2023-05-02 09:02:22 +1000
committerNathan Scott <nathans@redhat.com>2023-05-08 13:06:07 +1000
commit0bdade1b6cb40c5bd374a93ac0489058a7421bb5 (patch)
tree0e0225f7dbf6867402c5ed3481a705d01941f42e /DiskIOMeter.c
parente4ebe18b67c366d367231a1123b057c82018cf5b (diff)
Introduce Machine class for host-specific info (split from ProcessList)
First stage in sanitizing the process list structure so that htop can support other types of lists too (cgroups, filesystems, ...), in the not-too-distant future. This introduces struct Machine for system-wide information while keeping process-list information in ProcessList (now much less). Next step is to propogate this separation into each platform, to match these core changes.
Diffstat (limited to 'DiskIOMeter.c')
-rw-r--r--DiskIOMeter.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/DiskIOMeter.c b/DiskIOMeter.c
index adab8f73..545ec008 100644
--- a/DiskIOMeter.c
+++ b/DiskIOMeter.c
@@ -32,10 +32,10 @@ static uint32_t cached_write_diff;
static double cached_utilisation_diff;
static void DiskIOMeter_updateValues(Meter* this) {
- const ProcessList* pl = this->pl;
+ const Machine* host = this->host;
static uint64_t cached_last_update;
- uint64_t passedTimeInMs = pl->realtimeMs - cached_last_update;
+ uint64_t passedTimeInMs = host->realtimeMs - cached_last_update;
/* update only every 500ms to have a sane span for rate calculation */
if (passedTimeInMs > 500) {
@@ -55,7 +55,7 @@ static void DiskIOMeter_updateValues(Meter* this) {
status = RATESTATUS_DATA;
}
- cached_last_update = pl->realtimeMs;
+ cached_last_update = host->realtimeMs;
if (status == RATESTATUS_NODATA) {
xSnprintf(this->txtBuffer, sizeof(this->txtBuffer), "no data");

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