fix compression

This commit is contained in:
2026-03-10 14:38:51 +00:00
parent 3ffaf0cc4d
commit 7635caa71d
6 changed files with 182 additions and 27 deletions

View File

@@ -42,16 +42,22 @@ docker run -p 8080:8080 -v $(pwd)/data:/app/data myapp:test
Add services from the dashboard (e.g. `https://example.com`, `google.com:443` for TCP) and view reports.
### Check Retention
### Check Retention and Rollups
To limit database growth, the app prunes old checks every 15 minutes:
To limit database growth, the app **rolls up** old checks into hourly aggregates, then prunes raw data:
1. **Rollup** (every 15 min): Checks older than `ROLLUP_AGE_HOURS` are aggregated into hourly buckets (total, success count, latency stats) and stored in `uptime_rollups`. Raw checks in those hours are deleted.
2. **Prune**: Keeps last `CHECK_RETENTION_COUNT` raw checks per service; optionally deletes by age.
This lets you report accurate uptime over **90+ days** without storing millions of raw checks. Reports combine rollups (historical) + raw checks (recent).
| Env var | Default | Description |
|---------|---------|-------------|
| `CHECK_RETENTION_COUNT` | 5000 | Keep last N checks per service |
| `ROLLUP_AGE_HOURS` | 24 | Aggregate checks older than N hours into hourly buckets |
| `CHECK_RETENTION_COUNT` | 5000 | Keep last N raw checks per service |
| `CHECK_RETENTION_DAYS` | 0 (disabled) | Also delete checks older than N days |
Example: keep 2000 checks per service and drop anything older than 30 days:
Example: keep 2000 raw checks per service and drop anything older than 30 days:
```bash
docker run -e CHECK_RETENTION_COUNT=2000 -e CHECK_RETENTION_DAYS=30 ...