ops: Disk tier occupancy on /metrics
Operators could see attach-ready and capacity-pressure events but not how full the configured disk (or memory) tier was without reading filesystems. Expose size/capacity gauges and disk_cache_full_ratio next to disk_tier_ready. Capacity is a config read, so it stays available while attach is pending.
This commit was merged in pull request #53.
This commit is contained in:
@@ -352,6 +352,11 @@ func (sc *SteamCache) Shutdown() {
|
||||
func (sc *SteamCache) GetMetrics() *metrics.Stats {
|
||||
if sc.memory != nil {
|
||||
sc.metrics.SetMemoryCacheSize(sc.memory.Size())
|
||||
sc.metrics.SetMemoryCacheCapacity(sc.memory.Capacity())
|
||||
}
|
||||
if sc.disk != nil {
|
||||
// Capacity() is a plain config field — safe to read even while disk attach is pending.
|
||||
sc.metrics.SetDiskCacheCapacity(sc.disk.Capacity())
|
||||
}
|
||||
// Skip disk.Size() while attach pending — Size() blocks on initDone and would hang /metrics.
|
||||
if sc.disk != nil && sc.metrics.GetDiskTierReady() == 1 {
|
||||
|
||||
Reference in New Issue
Block a user