Skip to content

Commit

Permalink
arcstat: add target size of data, meta, MFU, MRU
Browse files Browse the repository at this point in the history
arcstat: add target size of ARC data, ARC metadata, MFU, MRU

Signed-off-by: Theera K. <[email protected]>
  • Loading branch information
tkittich authored Sep 10, 2024
1 parent d6b3ea4 commit 6e8c31c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions cmd/arcstat.in
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ typefields = {
}
typestats = { # size stats
"percent": "cachessz", # percentage of this value
"tg": ["_target", "target"],
"sz": ["_size", "size"],
}

Expand All @@ -206,6 +207,7 @@ statefields = {
targetstats = {
"percent": "cachessz", # percentage of this value
"fields": ["mfu", "mru"], # only applicable to these fields
"tg": ["_target", "target"],
"dat": ["_data_target", "data target"],
"met": ["_metadata_target", "metadata target"],
}
Expand Down Expand Up @@ -362,7 +364,7 @@ def snap_stats():
kstat_update()

cur = kstat

# fill in additional values from arc_summary
cur["caches_size"] = caches_size = cur["anon_data"]+cur["anon_metadata"]+\
cur["mfu_data"]+cur["mfu_metadata"]+cur["mru_data"]+cur["mru_metadata"]+\
Expand All @@ -379,7 +381,12 @@ def snap_stats():
cur["mru_data_target"] = v / 65536 * caches_size / 65536
v = int(pm)*int(meta)/s
cur["mru_metadata_target"] = v / 65536 * caches_size / 65536


cur["data_target"] = cur["mfu_data_target"] + cur["mru_data_target"]
cur["metadata_target"] = cur["mfu_metadata_target"] + cur["mru_metadata_target"]
cur["mfu_target"] = cur["mfu_data_target"] + cur["mfu_metadata_target"]
cur["mru_target"] = cur["mru_data_target"] + cur["mru_metadata_target"]

for key in cur:
if re.match(key, "class"):
continue
Expand Down

0 comments on commit 6e8c31c

Please sign in to comment.