Skip to content

feat(git): instrument background prewarm with metrics#315

Draft
worstell wants to merge 1 commit into
feat/git-warm-cache-readinessfrom
feat/git-prewarm-metrics
Draft

feat(git): instrument background prewarm with metrics#315
worstell wants to merge 1 commit into
feat/git-warm-cache-readinessfrom
feat/git-prewarm-metrics

Conversation

@worstell
Copy link
Copy Markdown
Contributor

@worstell worstell commented May 19, 2026

Stacks on #299. Adds three metrics for the background prewarm pass:

  • cachew.git.prewarm_repo_duration_seconds (histogram): per-repo wall time, labelled path (fetch = mirror already on disk, restore = mirror snapshot pull or full clone) and status (success | error).
  • cachew.git.prewarm_pass_duration_seconds (histogram): total pass wall time, labelled outcome (complete | empty_histogram).
  • cachew.git.prewarm_passes_total (counter): pass completions by outcome.

Pair with cachew.git.snapshot_serves_total{source=...} to validate that prewarmed repos correlate with cache-hit serve rates. If the data shows prewarm isn't moving the needle on first-request latency or upstream load, we have justification to drop the prewarm work entirely.

@worstell worstell force-pushed the feat/git-warm-cache-readiness branch 2 times, most recently from fc8e253 to 1a1728f Compare May 19, 2026 20:59
Adds three metrics for the prewarm-most-cloned-repos background pass:
- cachew.git.prewarm_repo_duration_seconds (histogram, labelled path=fetch|restore, status=success|error)
- cachew.git.prewarm_pass_duration_seconds (histogram, labelled outcome=complete|empty_histogram)
- cachew.git.prewarm_passes_total (counter, labelled outcome)

These let us see whether prewarm is actually paying off — pair with cachew.git.snapshot_serves_total{source=...} to validate that warm repos correlate with cache-hit serve rates.

Amp-Thread-ID: https://ampcode.com/threads/T-019e4193-0c35-732e-96f0-b9c97aed2fae
Co-authored-by: Amp <amp@ampcode.com>
@worstell worstell force-pushed the feat/git-prewarm-metrics branch from c30fef7 to 3269465 Compare May 19, 2026 21:00
@worstell worstell changed the title feat(git): instrument readiness-gate prewarm with metrics feat(git): instrument background prewarm with metrics May 19, 2026
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.

1 participant