feat(git): per-repo clone histogram in metadata DB#292
Conversation
|
@codex review |
4e73b62 to
1005703
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 12e84a01ec
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
a3d932b to
ef5f4ef
Compare
ef80fc4 to
877f001
Compare
60bdd0b to
af695f6
Compare
|
@codex review |
💡 Codex Review
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
0d885c6 to
4c6d1ca
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
| var metaStore atomic.Pointer[metadatadb.Store] | ||
| metaStoreProvider := metadatadb.StoreProvider(sync.OnceValues(func() (*metadatadb.Store, error) { | ||
| s := metaStore.Load() |
There was a problem hiding this comment.
Can you refactor this to use the existing "provider function" pattern, that uses sync.OnceValues()? There are a few examples.
There was a problem hiding this comment.
It also shouldn't be in main, it should be in the metadatadb package
4c6d1ca to
99d1af3
Compare
99d1af3 to
ec7ec3c
Compare
Adds RepoCounts: a daily-bucketed metadatadb.IntMap keyed by "<upstream-url>|<YYYY-MM-DD>" tracking clones (POST /git-upload-pack with no "have" lines, v1 or v2; excludes fetches, ls-refs, info/refs). Increments after upstream URL validation. Daily reaper drops buckets older than 90 days. Strategies opt in via the new strategy.MetadataConsumer interface; config.Load installs the *metadatadb.Store on each consumer after the backend is built. Intended to feed a future warmup readiness gate. Amp-Thread-ID: https://ampcode.com/threads/T-019dfa1e-79d3-710b-8e22-2097597de66c Co-authored-by: Amp <amp@ampcode.com>
ec7ec3c to
dbed637
Compare
Adds
RepoCounts: a daily-bucketedmetadatadb.IntMap[string]keyed by<upstream-url>|<YYYY-MM-DD>that tracks per-repo clone counts. Intended to feed a future readiness gate that pre-warms popular repos before a pod starts serving traffic.POST /git-upload-packwhose body has nohave <oid>lines (v1 or v2). Fetches,GET /info/refs, and v2command=ls-refsare excluded — fetch volume is dominated by automation cadence (CI bots polling) rather than user demand.RequestIsClonebuffers/replays the body, decodes gzip, and scans up to 64 KiB so multi-want fetches aren't misclassified.cloneManager.GetOrCreateaccepts the URL, so unauthenticated callers can't bloat the keyspace.metadatadb.NamespaceProvider,git.New/Registeraccept it (nil-safe),config.Loadgains asetMetadataStorecallback, andcmd/cachewdholds the store in anatomic.Pointerso the provider closure can resolve the"git"namespace at strategy-construction time.