diff options
author | Giuseppe Di Natale <[email protected]> | 2017-10-23 14:18:12 -0700 |
---|---|---|
committer | Tony Hutter <[email protected]> | 2017-11-20 16:19:23 -0600 |
commit | 029a1b0c207f204b1b78086b009c6de8fc383cb3 (patch) | |
tree | b7b93d7cb1783e8c5afe9dd30b3a2d39b47a8729 /cmd | |
parent | c45254b0ecccd7e9b26b84fe605cdb87901f3ba9 (diff) |
Ensure arc_size_break is filled in arc_summary.py
Use mfu_size and mru_size pulled from the arcstats
kstat file to calculate the mfu and mru percentages
for arc size breakdown.
Reviewed-by: George Melikov <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Richard Elling <[email protected]>
Reviewed-by: AndCycle <[email protected]>
Signed-off-by: Giuseppe Di Natale <[email protected]>
Closes #5526
Closes #6770
Diffstat (limited to 'cmd')
-rwxr-xr-x | cmd/arc_summary/arc_summary.py | 32 |
1 files changed, 10 insertions, 22 deletions
diff --git a/cmd/arc_summary/arc_summary.py b/cmd/arc_summary/arc_summary.py index f5aac737b..93918a08f 100755 --- a/cmd/arc_summary/arc_summary.py +++ b/cmd/arc_summary/arc_summary.py @@ -185,7 +185,8 @@ def get_arc_summary(Kstat): # ARC Sizing arc_size = Kstat["kstat.zfs.misc.arcstats.size"] - mru_size = Kstat["kstat.zfs.misc.arcstats.p"] + mru_size = Kstat["kstat.zfs.misc.arcstats.mru_size"] + mfu_size = Kstat["kstat.zfs.misc.arcstats.mfu_size"] target_max_size = Kstat["kstat.zfs.misc.arcstats.c_max"] target_min_size = Kstat["kstat.zfs.misc.arcstats.c_min"] target_size = Kstat["kstat.zfs.misc.arcstats.c"] @@ -230,27 +231,14 @@ def get_arc_summary(Kstat): ] output['arc_size_break'] = {} - if arc_size > target_size: - mfu_size = (arc_size - mru_size) - output['arc_size_break']['recently_used_cache_size'] = { - 'per': fPerc(mru_size, arc_size), - 'num': fBytes(mru_size), - } - output['arc_size_break']['frequently_used_cache_size'] = { - 'per': fPerc(mfu_size, arc_size), - 'num': fBytes(mfu_size), - } - - elif arc_size < target_size: - mfu_size = (target_size - mru_size) - output['arc_size_break']['recently_used_cache_size'] = { - 'per': fPerc(mru_size, target_size), - 'num': fBytes(mru_size), - } - output['arc_size_break']['frequently_used_cache_size'] = { - 'per': fPerc(mfu_size, target_size), - 'num': fBytes(mfu_size), - } + output['arc_size_break']['recently_used_cache_size'] = { + 'per': fPerc(mru_size, mru_size + mfu_size), + 'num': fBytes(mru_size), + } + output['arc_size_break']['frequently_used_cache_size'] = { + 'per': fPerc(mfu_size, mru_size + mfu_size), + 'num': fBytes(mfu_size), + } # ARC Hash Breakdown hash_chain_max = Kstat["kstat.zfs.misc.arcstats.hash_chain_max"] |