From 0bdade1b6cb40c5bd374a93ac0489058a7421bb5 Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Tue, 2 May 2023 09:02:22 +1000 Subject: 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. --- NetworkIOMeter.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'NetworkIOMeter.c') 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"); -- cgit v1.2.3