feat(git): instrument background prewarm with metrics#315
Draft
worstell wants to merge 1 commit into
Draft
Conversation
worstell
force-pushed
the
feat/git-warm-cache-readiness
branch
2 times, most recently
from
May 19, 2026 20:59
fc8e253 to
1a1728f
Compare
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
force-pushed
the
feat/git-prewarm-metrics
branch
from
May 19, 2026 21:00
c30fef7 to
3269465
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacks on #299. Adds three metrics for the background prewarm pass:
cachew.git.prewarm_repo_duration_seconds(histogram): per-repo wall time, labelledpath(fetch= mirror already on disk,restore= mirror snapshot pull or full clone) andstatus(success|error).cachew.git.prewarm_pass_duration_seconds(histogram): total pass wall time, labelledoutcome(complete|empty_histogram).cachew.git.prewarm_passes_total(counter): pass completions byoutcome.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.