This commit is contained in:
@@ -25,6 +25,8 @@ Tiny API that clones a Git repo and counts its non-empty lines of code.
|
||||
- Returns both snapshots and their total/per-language LOC delta.
|
||||
- `GET /health`
|
||||
- Health plus queue/cache stats.
|
||||
- `GET /metrics`
|
||||
- Prometheus-compatible request, cache, scan, file, and line counters. Protected by the API key when one is configured.
|
||||
|
||||
## Auth
|
||||
|
||||
@@ -70,6 +72,12 @@ curl "http://localhost:3000/ssh/public-key?ssh_key=loc_via_git_ed25519"
|
||||
- The service also sweeps stale temp directories in case a process dies mid-scan.
|
||||
- Cache entries live in memory only and expire after `CACHE_TTL_MINUTES`.
|
||||
|
||||
## Operations
|
||||
|
||||
- Requests emit structured JSON logs with an opaque request ID, route, status, and duration. Query strings and API keys are never logged.
|
||||
- The service handles `SIGINT` and `SIGTERM`: it stops accepting new connections, clears its cleanup timer, and exits after active connections drain (or 10 seconds).
|
||||
- `/metrics` is compatible with Prometheus scraping. `/health` remains unauthenticated for container health checks.
|
||||
|
||||
## Counting rules
|
||||
|
||||
- Only text files are counted.
|
||||
|
||||
Reference in New Issue
Block a user