From b29b33ebb9ae80a95e7d09eb537e0fccc5043d68 Mon Sep 17 00:00:00 2001 From: Ivan Shapovalov Date: Tue, 27 Dec 2022 04:57:52 +0400 Subject: {Memory,Swap}Meter: add "compressed memory" metrics For now, the semantics are mostly fit for Linux zswap subsystem. For instance, we add the third swap usage metric that indicates the amount of memory that is accounted to swap but in fact stored elsewhere. This exactly matches the definition of frontswap/zswap, and is probably of little use to all other platforms. --- freebsd/Platform.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'freebsd') diff --git a/freebsd/Platform.c b/freebsd/Platform.c index 618ed6b4..cab80929 100644 --- a/freebsd/Platform.c +++ b/freebsd/Platform.c @@ -236,6 +236,7 @@ void Platform_setMemoryValues(Meter* this) { this->values[MEMORY_METER_USED] = pl->usedMem; this->values[MEMORY_METER_BUFFERS] = pl->buffersMem; this->values[MEMORY_METER_SHARED] = pl->sharedMem; + // this->values[MEMORY_METER_COMPRESSED] = "compressed memory, like zswap on linux" this->values[MEMORY_METER_CACHE] = pl->cachedMem; // this->values[MEMORY_METER_AVAILABLE] = "available memory" @@ -254,7 +255,8 @@ void Platform_setSwapValues(Meter* this) { const ProcessList* pl = this->pl; this->total = pl->totalSwap; this->values[SWAP_METER_USED] = pl->usedSwap; - this->values[SWAP_METER_CACHE] = NAN; + // this->values[SWAP_METER_CACHE] = "pages that are both in swap and RAM, like SwapCached on linux" + // this->values[SWAP_METER_FRONTSWAP] = "pages that are accounted to swap but stored elsewhere, like frontswap on linux" } void Platform_setZfsArcValues(Meter* this) { -- cgit v1.2.3