Skip to content

sp stats — fun store metrics - #35

Merged
rwrife merged 1 commit into
mainfrom
issue-32-sp-stats
Jul 15, 2026
Merged

sp stats — fun store metrics#35
rwrife merged 1 commit into
mainfrom
issue-32-sp-stats

Conversation

@rwrife

@rwrife rwrife commented Jul 14, 2026

Copy link
Copy Markdown
Owner

Closes #32

Adds sp stats: a read-only metrics report over the index.

What it reports

  • Live count + bytes; morgue count + bytes (recoverable) with purgeable-past-grace count.
  • Oldest living scratch ("oldest survivor") and its age.
  • Total bytes held by the store (live + morgue) — honestly labeled, no fabricated all-time counters (v0.1 keeps none on disk).
  • Top-N tag breakdown (living scratches only), ranked by count then name.
  • --json for scripting (color/personality-free), mirroring ls --json / doctor --json. oldest is null on empty store; tags always an array.

Structure follows existing patterns: computation in internal/store/stats.go (plain data), rendering in internal/render/stats.go, command in internal/cli/stats.go adapting store→render types (same one-way dependency arrow doctor/reap use).

Tests cover empty store, mixed live/morgue, purgeable counting, oldest-survivor selection, tag-breakdown ordering, morgue tags excluded, JSON shape + null-oldest zero-state, and full command wiring.

README updated with a sp stats section + quickstart lines.

Acceptance criteria all met. All tests + go vet green.

@rwrife
rwrife merged commit 8cb41be into main Jul 15, 2026
1 check passed
@rwrife
rwrife deleted the issue-32-sp-stats branch July 15, 2026 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feature] sp stats — fun store metrics

1 participant