diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2026-01-12 09:52:36 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2026-01-12 09:52:36 +0000 |
| commit | 93227ce02e484c1e727bfd07ceeb72fd95774170 (patch) | |
| tree | d02c99355b083c4a30f2ae75f42eaaa70d213b24 /src/git | |
| parent | a63dc8a9e5f9cad50f4ea7c6c5d2ed544bc70656 (diff) | |
fix(metrics): count repositories on disk on each metrics request
Implements ngit_repositories_total metric by counting *.git directories
on disk every time /metrics is requested (~15s interval by Prometheus).
This approach is simpler than increment-on-create because:
- No need to pass metrics through the relay builder chain
- Always accurate and self-correcting
- Negligible performance impact (~100-200 dir entries)
Changes:
- Add count_repositories_on_disk() static method to Metrics
- Update Metrics::render() to count repos before encoding metrics
- Pass git_data_path to Metrics::new() in main.rs
- Consolidate metrics tests to avoid global Prometheus registry conflicts
Fixes repository count metric issue from Phase 8 deployment plan.
Diffstat (limited to 'src/git')
0 files changed, 0 insertions, 0 deletions