diff options
author | Ross Williams <ross@ross-williams.net> | 2019-07-07 17:30:37 -0400 |
---|---|---|
committer | Ross Williams <ross@ross-williams.net> | 2019-07-07 23:10:46 -0400 |
commit | fc8e9a2d3e25e35c0f9903baa345b1744b12b6cb (patch) | |
tree | 2b689eab1d4804a2f87ea1aa75cfdeea3f848d59 /darwin/Platform.c | |
parent | 070fe90461182743fabb029415fc1bc59be14f3f (diff) |
ZFS arcstats for Darwin (macOS / OS X)
Diffstat (limited to 'darwin/Platform.c')
-rw-r--r-- | darwin/Platform.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/darwin/Platform.c b/darwin/Platform.c index 1dce8b67..52d60a9b 100644 --- a/darwin/Platform.c +++ b/darwin/Platform.c @@ -15,6 +15,7 @@ in the source distribution for its full text. #include "ClockMeter.h" #include "HostnameMeter.h" #include "UptimeMeter.h" +#include "zfs/ZfsArcMeter.h" #include "DarwinProcessList.h" #include <stdlib.h> @@ -117,6 +118,7 @@ MeterClass* Platform_meterTypes[] = { &RightCPUsMeter_class, &LeftCPUs2Meter_class, &RightCPUs2Meter_class, + &ZfsArcMeter_class, &BlankMeter_class, NULL }; @@ -241,6 +243,23 @@ void Platform_setSwapValues(Meter* mtr) { mtr->values[0] = swapused.xsu_used / 1024; } +void Platform_setZfsArcValues(Meter* this) { + DarwinProcessList* dpl = (DarwinProcessList*) this->pl; + + this->total = dpl->zfsArcMax; + this->values[0] = dpl->zfsArcMFU; + this->values[1] = dpl->zfsArcMRU; + this->values[2] = dpl->zfsArcAnon; + this->values[3] = dpl->zfsArcHeader; + this->values[4] = dpl->zfsArcOther; + + // "Hide" the last value so it can + // only be accessed by index and is not + // displayed by the Bar or Graph style + Meter_setItems(this, 5); + this->values[5] = dpl->zfsArcSize; +} + char* Platform_getProcessEnv(pid_t pid) { char* env = NULL; |