ops: Disk tier occupancy on /metrics #53

Merged
eva merged 1 commits from ops/disk-tier-occupancy-metrics into develop 2026-09-09 11:19:06 -05:00
Collaborator

Why

After disk-tier attach-ready (#33 / #45) and capacity-pressure (#46), operators still could not tell "disk is 95% full" vs "barely filled" from /metrics alone.

What

  • Add memory_cache_capacity / disk_cache_capacity gauges (configured bytes; disk capacity 0 when no disk)
  • Add disk_cache_full_ratio (size/capacity in [0,1]) next to existing size gauges and disk_tier_ready
  • Wire capacities in GetMetrics() via Capacity() (safe during pending attach; still skip disk.Size() while pending)
  • Document in README metrics table + disk-tier notes

Test

  • go test ./steamcache/metrics ./steamcache -count=1
  • New coverage: WriteText samples, ratio clamp, pending-attach non-blocking capacity report, post-attach occupancy

Rollback

git revert the merge commit. No DB / schema.

Implements: #41

Do not merge yourself — leave merge to reviewer.

## Why After disk-tier attach-ready (#33 / #45) and capacity-pressure (#46), operators still could not tell "disk is 95% full" vs "barely filled" from `/metrics` alone. ## What - Add `memory_cache_capacity` / `disk_cache_capacity` gauges (configured bytes; disk capacity 0 when no disk) - Add `disk_cache_full_ratio` (size/capacity in [0,1]) next to existing size gauges and `disk_tier_ready` - Wire capacities in `GetMetrics()` via `Capacity()` (safe during pending attach; still skip `disk.Size()` while pending) - Document in README metrics table + disk-tier notes ## Test - `go test ./steamcache/metrics ./steamcache -count=1` - New coverage: WriteText samples, ratio clamp, pending-attach non-blocking capacity report, post-attach occupancy ## Rollback `git revert` the merge commit. No DB / schema. Implements: https://git.s1d3sw1ped.com/s1d3sw1ped/steamcache2/issues/41 Do not merge yourself — leave merge to reviewer.
pike added 1 commit 2026-09-09 11:06:13 -05:00
ops: Disk tier occupancy on /metrics
CI / vulncheck (pull_request) Successful in 19s
CI / check-and-test (pull_request) Successful in 47s
CI / vulncheck (push) Successful in 16s
CI / check-and-test (push) Successful in 46s
Release Tag / release (push) Successful in 14s
50ca0a071c
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.
pike requested review from eva 2026-09-09 11:06:24 -05:00
eva approved these changes 2026-09-09 11:18:45 -05:00
eva left a comment
Owner

LGTM — occupancy gauges match #41; Capacity() safe during pending attach; no service-label collision; CI green (check-and-test + vulncheck). Merging FF.

LGTM — occupancy gauges match #41; Capacity() safe during pending attach; no service-label collision; CI green (check-and-test + vulncheck). Merging FF.
eva merged commit 50ca0a071c into develop 2026-09-09 11:19:06 -05:00
eva deleted branch ops/disk-tier-occupancy-metrics 2026-09-09 11:19:06 -05:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: s1d3sw1ped/steamcache2#53