summaryrefslogtreecommitdiffstats
path: root/pcp
diff options
context:
space:
mode:
authorNathan Scott <nathans@redhat.com>2021-02-22 16:54:33 +1100
committerNathan Scott <nathans@redhat.com>2021-06-09 17:09:29 +1000
commitc6f20fbcc684bc7dd6d2805f1072c651b733d259 (patch)
tree5ce85c146e1293f5919f19bb4ecbdfb7b0ae67d9 /pcp
parent0e7ae9a59296823770fa1f470192e8a7b569d302 (diff)
Fixes and cleanups for ZFS Meters and metrics
Diffstat (limited to 'pcp')
-rw-r--r--pcp/PCPProcessList.c40
1 files changed, 18 insertions, 22 deletions
diff --git a/pcp/PCPProcessList.c b/pcp/PCPProcessList.c
index 0e7b26d5..a823695e 100644
--- a/pcp/PCPProcessList.c
+++ b/pcp/PCPProcessList.c
@@ -737,39 +737,35 @@ static inline void PCPProcessList_scanZfsArcstats(PCPProcessList* this) {
unsigned long long int dbufSize = 0;
unsigned long long int dnodeSize = 0;
unsigned long long int bonusSize = 0;
- pmAtomValue value,
- comp,
- uncomp;
+ pmAtomValue value;
+ memset(&this->zfs, 0, sizeof(ZfsArcStats));
if (Metric_values(PCP_ZFS_ARC_ANON_SIZE, &value, 1, PM_TYPE_U64))
- this->zfs.anon = value.ull / 1024;
+ this->zfs.anon = value.ull / ONE_K;
if (Metric_values(PCP_ZFS_ARC_C_MAX, &value, 1, PM_TYPE_U64))
- this->zfs.max = value.ull / 1024;
+ this->zfs.max = value.ull / ONE_K;
if (Metric_values(PCP_ZFS_ARC_BONUS_SIZE, &value, 1, PM_TYPE_U64))
- bonusSize = value.ull / 1024;
+ bonusSize = value.ull / ONE_K;
if (Metric_values(PCP_ZFS_ARC_DBUF_SIZE, &value, 1, PM_TYPE_U64))
- dbufSize = value.ull / 1024;
+ dbufSize = value.ull / ONE_K;
if (Metric_values(PCP_ZFS_ARC_DNODE_SIZE, &value, 1, PM_TYPE_U64))
- dnodeSize = value.ull / 1024;
- if (Metric_values(PCP_ZFS_ARC_COMPRESSED_SIZE, &comp, 1, PM_TYPE_U64)) {
- this->zfs.isCompressed = 1;
- }
- if (Metric_values(PCP_ZFS_ARC_UNCOMPRESSED_SIZE, &uncomp, 1, PM_TYPE_U64))
+ dnodeSize = value.ull / ONE_K;
+ if (Metric_values(PCP_ZFS_ARC_COMPRESSED_SIZE, &value, 1, PM_TYPE_U64))
+ this->zfs.compressed = value.ull / ONE_K;
+ if (Metric_values(PCP_ZFS_ARC_UNCOMPRESSED_SIZE, &value, 1, PM_TYPE_U64))
+ this->zfs.uncompressed = value.ull / ONE_K;
if (Metric_values(PCP_ZFS_ARC_HDR_SIZE, &value, 1, PM_TYPE_U64))
- this->zfs.header = value.ull / 1024;
+ this->zfs.header = value.ull / ONE_K;
if (Metric_values(PCP_ZFS_ARC_MFU_SIZE, &value, 1, PM_TYPE_U64))
- this->zfs.MFU = value.ull / 1024;
+ this->zfs.MFU = value.ull / ONE_K;
if (Metric_values(PCP_ZFS_ARC_MRU_SIZE, &value, 1, PM_TYPE_U64))
- this->zfs.MRU = value.ull / 1024;
+ this->zfs.MRU = value.ull / ONE_K;
if (Metric_values(PCP_ZFS_ARC_SIZE, &value, 1, PM_TYPE_U64))
- this->zfs.size = value.ull / 1024;
+ this->zfs.size = value.ull / ONE_K;
- this->zfs.enabled = (this->zfs.size > 0 ? 1 : 0);
- this->zfs.other = (dbufSize + dnodeSize + bonusSize) / 1024;
- if ( this->zfs.isCompressed ) {
- this->zfs.compressed = comp.ull /1024;
- this->zfs.uncompressed = uncomp.ull /1024;
- }
+ this->zfs.other = (dbufSize + dnodeSize + bonusSize) / ONE_K;
+ this->zfs.enabled = (this->zfs.size > 0);
+ this->zfs.isCompressed = (this->zfs.compressed > 0);
}
void ProcessList_goThroughEntries(ProcessList* super, bool pauseProcessUpdate) {

© 2014-2024 Faster IT GmbH | imprint | privacy policy