diff options
author | Nathan Scott <nathans@redhat.com> | 2023-05-02 09:02:22 +1000 |
---|---|---|
committer | Nathan Scott <nathans@redhat.com> | 2023-05-08 13:06:07 +1000 |
commit | 0bdade1b6cb40c5bd374a93ac0489058a7421bb5 (patch) | |
tree | 0e0225f7dbf6867402c5ed3481a705d01941f42e /NetworkIOMeter.c | |
parent | e4ebe18b67c366d367231a1123b057c82018cf5b (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 'NetworkIOMeter.c')
-rw-r--r-- | NetworkIOMeter.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/NetworkIOMeter.c b/NetworkIOMeter.c index d41eafa8..5945bae7 100644 --- a/NetworkIOMeter.c +++ b/NetworkIOMeter.c @@ -26,10 +26,10 @@ static uint32_t cached_txb_diff; static uint32_t cached_txp_diff; static void NetworkIOMeter_updateValues(Meter* this) { - const ProcessList* pl = this->pl; + const Machine* host = this->host; static uint64_t cached_last_update = 0; - 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) { @@ -50,7 +50,7 @@ static void NetworkIOMeter_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"); |