The ZFS tab shows the ARC, and names every caching tier a pool has or lacks

A Cache section between the pools and the schedules. One card for the ARC:
size against its ceiling with the target and floor, sparklines of size and
hit rate from the sampler's history, what it holds (MRU/MFU/dirty, data vs
metadata, compression, the ghost lists), the prefetcher and dbuf cache, the
memory-pressure counters, and the since-boot breakdown by demand/prefetch
and data/metadata. Then a card per pool for L2ARC, SLOG, special vdev,
dedup table and spares — the devices and their fill where they exist, and
where they don't, plainly none and what that means (the ZIL writing to the
pool's own vdevs, with how much it has written).

Live numbers come from the sampler, which reads arcstats every tick and
publishes zfs.arc.* sensors; the fuller picture is read on request, with
zpool list -Hpv and zfs get run without sudo and cached for thirty seconds.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Mitchell-Johnson
2026-10-02 18:30:02 -07:00
co-authored by Claude Fable 5.1
parent db40220365
commit b44faf3ac9
13 changed files with 736 additions and 2 deletions
+27
View File
@@ -173,6 +173,33 @@ func flatten(s Sample, want func(id string) bool) []sensors.Sensor {
f.add(p+".clients", g.Name+" clients", "count", "", float64(len(g.Clients)), t, none, lbl...)
}
if a := s.ARC; a != nil {
p := "zfs.arc."
cap := upTo(float64(a.Max))
f.add(p+"size", "ARC size", "bytes", "B", float64(a.Size), t, cap)
f.add(p+"target", "ARC target", "bytes", "B", float64(a.Target), t, cap)
f.add(p+"min", "ARC floor", "bytes", "B", float64(a.Min), t, none)
f.add(p+"max", "ARC ceiling", "bytes", "B", float64(a.Max), t, none)
f.add(p+"mru", "ARC recently used", "bytes", "B", float64(a.MRU), t, cap)
f.add(p+"mfu", "ARC frequently used", "bytes", "B", float64(a.MFU), t, cap)
f.add(p+"metadata", "ARC metadata", "bytes", "B", float64(a.Metadata), t, cap)
f.add(p+"data", "ARC data", "bytes", "B", float64(a.Data), t, cap)
if a.HitPctKnown {
f.add(p+"hit_pct", "ARC hit rate", "usage", "%", a.HitPct, t, pct)
}
f.add(p+"reads", "ARC reads", "rate", "/s", a.ReadsPerSec, t, none)
f.add(p+"misses", "ARC misses", "rate", "/s", a.MissesPerSec, t, none)
f.add(p+"lifetime_hit_pct", "ARC hit rate since boot", "usage", "%", a.LifetimeHitPct, t, pct)
f.add(p+"no_grow", "ARC held by memory pressure", "state", "", a.NoGrow, t, none)
if a.Compressed > 0 {
f.add(p+"compress_ratio", "ARC compression", "ratio", "x", round1(float64(a.Uncompressed)/float64(a.Compressed)*10)/10, t, none)
}
if a.L2Size > 0 {
f.add(p+"l2_size", "L2ARC size", "bytes", "B", float64(a.L2Size), t, none)
f.add(p+"l2_hit_pct", "L2ARC hit rate", "usage", "%", a.L2HitPct, t, pct)
}
}
if u := s.UPS; u != nil {
ut := s.upsT
f.add("ups.battery", "UPS battery", "usage", "%", u.BatteryPct, ut, pct, "model", u.Model)