mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-14 04:54:37 +03:00
Support for ZFS Compressed ARC statistics
This commit is contained in:
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user