feat: add Prometheus metrics instrumentation

- New whisper_live/metrics.py with Counter, Gauge, Histogram metrics
- Track connections (opened/closed/rejected), transcription latency,
  audio processed, segments emitted, REST requests, and errors
- All metric helpers are no-ops when prometheus_client not installed
- --metrics_port CLI flag to expose /metrics endpoint (0 = disabled)
- Metrics integrated into server.py, base.py at key instrumentation points
- 17 new tests in tests/test_metrics.py (178 total passing)
This commit is contained in:
Aaron Boxer
2026-04-17 10:33:01 -04:00
committed by Aaron Boxer
parent 4210697ca6
commit ced4bdb737
7 changed files with 322 additions and 1 deletions
+4
View File
@@ -0,0 +1,4 @@
whisper_env
__pycache__
*.srt
*.wav