feat: uptime windows (24h/7d/30d) + downtime history + ring buffer #2

Merged
ti-paul merged 1 commit from feature/1-uptime-history-downtime into main 2026-05-11 01:50:59 +00:00
Member

Closes #1

Adds time-windowed uptime tracking and downtime history.

  • history.go: ring buffer for check results
    • UptimeSince(window) for any time range
    • RecentDowntime(limit) for failure period extraction
    • ComputeWindowedUptime() for 24h/7d/30d
  • API: /api/v1/status/{name} now includes downtime_recent
  • Dashboard: uptime windows with color coding
  • Configurable history_size (default 10000)
Closes #1 Adds time-windowed uptime tracking and downtime history. - history.go: ring buffer for check results - UptimeSince(window) for any time range - RecentDowntime(limit) for failure period extraction - ComputeWindowedUptime() for 24h/7d/30d - API: /api/v1/status/{name} now includes downtime_recent - Dashboard: uptime windows with color coding - Configurable history_size (default 10000)
feat: uptime windows (24h/7d/30d) + downtime history + ring buffer
All checks were successful
CI / test (pull_request) Successful in 8s
cb8fa2e9a0
- Add history.go: ring buffer CheckHistory for time-windowed uptime
  - Add(time) records each check with timestamp
  - UptimeSince(window) computes uptime % for any time range
  - RecentDowntime(limit) extracts consecutive failure periods
  - ComputeWindowedUptime() returns 24h/7d/30d stats
- Update main.go to track history per clanker
  - New /api/v1/status/{name} includes downtime_recent array
  - All status responses include windowed uptime data
  - Configurable history_size (default: 10000 checks)
- Update index.html dashboard
  - Show 24h/7d/30d uptime windows per clanker
  - Color-coded: green >= 95%, yellow >= 80%, red < 80%
  - Responsive layout for mobile
  - Remove emoji from code (ASCII-safe)
- Closes #1
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
les_clankeurs/clanker-health!2
No description provided.