Files
ngit-grasp/src
DanConwayDev 93227ce02e 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.
2026-01-12 09:52:36 +00:00
..
2026-01-09 19:58:41 +00:00