Skip to content

feat(overview): live concurrency strip + per-account in-flight bars - #363

Merged
caigee-cmd merged 4 commits into
mainfrom
feat/live-concurrency
Oct 22, 2026
Merged

caigee-cmd merged 4 commits into
mainfrom
feat/live-concurrency

Conversation

@caigee-cmd

Copy link
Copy Markdown
Owner

Summary

  • Backend: new GET /api/live (console key) returning in_flight, capacity (sum of effective max_inflight over enabled accounts, default 4), rpm (requests started in last 60s), and per-account in_flight/max_inflight. RPM comes from an in-memory 60-bucket per-second ring (internal/logs/rate.go) bumped in RequestRecorder.Start — O(1), no SQLite query. Resets on restart.
  • Overview: live strip above the metrics: concurrency N / capacity with a thin load bar (warning tone when saturated), requests in last 60s, and a ~60s client-sampled recharts sparkline (no animation). Polls every 2.5s only while document is visible; keeps last snapshot, no skeleton flash.
  • Account pool: per-account in_flight/max_inflight thin bar (live-updated); saturated rows in warning tone. Quota bar gained a matching % label.
  • zh + en strings, changelog fragment changelog/unreleased/live-concurrency.md, rebuilt internal/webui/static.

Tests

  • internal/logs/rate_test.go (sliding window, slot wrap, nil-safety, recorder counts starts), internal/console/live_test.go (capacity only enabled, default max_inflight)
  • go test ./..., go build, tsc, oxlint, release-notes validate

Add GET /api/live (in_flight, capacity over enabled accounts, requests in
last 60s from an in-memory per-second ring, per-account in_flight) and poll
it every 2.5s on Overview while the tab is visible.
@caigee-cmd
caigee-cmd merged commit 77b7788 into main Oct 22, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant