Skip to content

Commit

Permalink
Update arcstat: add Anonymous, MFU, MRU, Uncached
Browse files Browse the repository at this point in the history
Signed-off-by: Theera K. <[email protected]>
  • Loading branch information
tkittich authored Sep 6, 2024
1 parent 3a858e4 commit 510fa6f
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions cmd/arcstat.in
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,6 @@ cols = {
"arcsz": [5, 1024, "ARC size"],
"size": [5, 1024, "ARC size"],
"c": [5, 1024, "ARC target size"],
"mfusz": [5, 1024, "MFU size"],
"mrusz": [5, 1024, "MRU size"],
"mfu": [4, 1000, "MFU list hits per second"],
"mru": [4, 1000, "MRU list hits per second"],
"mfug": [4, 1000, "MFU ghost list hits per second"],
Expand Down Expand Up @@ -171,6 +169,23 @@ cols = {
"zissued": [7, 1000, "zfetch prefetches issued per second"],
"zactive": [7, 1000, "zfetch prefetches active per second"],
}
fields = {
"ano": ["anon", "Anonymous"],
"mfu": ["mfu", "MFU"],
"mru": ["mru", "MRU"],
"unc": ["uncached", "Uncached"],
}
stats = {
"sz": ["_size", "size"],
"data": ["_data", "data size"],
"meta": ["_metadata", "metadata size"],
"edata": ["_evictable_data", "evictable data size"],
"emeta": ["_evictable_metadata", "evictable metadata size"],
}
for stat, statval in stats.items():
for field, fieldval in fields.items():
colname = field + stat
cols[colname] = [len(colname), 1024, fieldval[1] + " " + statval[1]]

v = {}
hdr = ["time", "read", "ddread", "ddh%", "dmread", "dmh%", "pread", "ph%",
Expand Down Expand Up @@ -509,6 +524,8 @@ def calculate():
global d
global v
global l2exist
global fields
global stats

v = dict()
v["time"] = time.strftime("%H:%M:%S", time.localtime())
Expand Down Expand Up @@ -588,11 +605,13 @@ def calculate():
v["mi%"] = 100 * v["mioh"] // v["mread"] if v["mread"] > 0 else 0
v["mm%"] = 100 - v["mh%"] - v["mi%"] if v["mread"] > 0 else 0

for stat, statval in stats.items():
for field, fieldval in fields.items():
v[field + stat] = cur[fieldval[0] + statval[0]]

v["arcsz"] = cur["size"]
v["size"] = cur["size"]
v["c"] = cur["c"]
v["mfusz"] = cur["mfu_size"]
v["mrusz"] = cur["mru_size"]
v["mfu"] = d["mfu_hits"] // sint
v["mru"] = d["mru_hits"] // sint
v["mrug"] = d["mru_ghost_hits"] // sint
Expand Down

0 comments on commit 510fa6f

Please sign in to comment.