Support for ZFS Compressed ARC statistics

This commit is contained in:
Ross Williams
2019-09-03 18:26:02 +00:00
parent e450b58636
commit 613556faeb
18 changed files with 215 additions and 4 deletions

View File

@ -18,6 +18,7 @@ in the source distribution for its full text.
#include "HostnameMeter.h"
#include "UptimeMeter.h"
#include "zfs/ZfsArcMeter.h"
#include "zfs/ZfsCompressedArcMeter.h"
#include "SolarisProcess.h"
#include "SolarisProcessList.h"
@ -124,6 +125,7 @@ MeterClass* Platform_meterTypes[] = {
&LeftCPUs2Meter_class,
&RightCPUs2Meter_class,
&ZfsArcMeter_class,
&ZfsCompressedArcMeter_class,
&BlankMeter_class,
NULL
};
@ -228,6 +230,12 @@ void Platform_setZfsArcValues(Meter* this) {
ZfsArcMeter_readStats(this, &(spl->zfs));
}
void Platform_setZfsCompressedArcValues(Meter* this) {
SolarisProcessList* spl = (SolarisProcessList*) this->pl;
ZfsCompressedArcMeter_readStats(this, &(spl->zfs));
}
static int Platform_buildenv(void *accum, struct ps_prochandle *Phandle, uintptr_t addr, const char *str) {
envAccum *accump = accum;
(void) Phandle;

View File

@ -62,6 +62,8 @@ void Platform_setSwapValues(Meter* this);
void Platform_setZfsArcValues(Meter* this);
void Platform_setZfsCompressedArcValues(Meter* this);
char* Platform_getProcessEnv(pid_t pid);
#endif

View File

@ -263,6 +263,16 @@ static inline void SolarisProcessList_scanZfsArcstats(ProcessList* pl) {
cur_kstat = kstat_data_lookup( arcstats, "other_size" );
spl->zfs.other = cur_kstat->value.ui64 / 1024;
if ((cur_kstat = kstat_data_lookup( arcstats, "compressed_size" )) != NULL) {
spl->zfs.compressed = cur_kstat->value.ui64 / 1024;
spl->zfs.isCompressed = 1;
cur_kstat = kstat_data_lookup( arcstats, "uncompressed_size" );
spl->zfs.uncompressed = cur_kstat->value.ui64 / 1024;
} else {
spl->zfs.isCompressed = 0;
}
}
}