Skip to content

Commit

Permalink
Ensure arc_size_break is filled in arc_summary.py
Browse files Browse the repository at this point in the history
When printing output in arc_summary, all possible keys
are expected in the output data structure. For the arc
size breakdown, output is conditionally filled and does
not expect arc target size to be equal to the arc size.

Also use mfu_size and mru_size pulled from the arcstats
kstat file.

Signed-off-by: Giuseppe Di Natale <dinatale2@llnl.gov>
  • Loading branch information
dinatale2 committed Oct 19, 2017
1 parent 6044cf5 commit cc8a63c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions cmd/arc_summary/arc_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down Expand Up @@ -231,7 +232,6 @@ 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),
Expand All @@ -241,8 +241,7 @@ def get_arc_summary(Kstat):
'num': fBytes(mfu_size),
}

elif arc_size < target_size:
mfu_size = (target_size - mru_size)
else:
output['arc_size_break']['recently_used_cache_size'] = {
'per': fPerc(mru_size, target_size),
'num': fBytes(mru_size),
Expand Down

0 comments on commit cc8a63c

Please sign in to comment.