Skip to content

feat(review): record each backend's busy time and concurrency in review profiles - #566

Merged
dan-petty merged 2 commits into
release/v0.2.23from
feat/557-backend-activity
Sep 25, 2026
Merged

dan-petty merged 2 commits into
release/v0.2.23from
feat/557-backend-activity

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

Summary

Profiles counted calls per backend, not how long each backend was busy or how many calls it had in flight at once. So #545's imbalance had to be measured with a script sampling nvidia-smi, and a benchmark could not show whether a routing change spread the load.

  • Per-stage backend activity (ai/review/profile.py). Each served call is placed on its backend's timeline: it ends when the observer sees it and started its duration earlier. Per stage and backend, the profile records:
    • calls;
    • busy_seconds, the union of the calls, so overlapping calls count once;
    • call_seconds;
    • peak_concurrency;
    • mean_concurrency.
  • Benchmarks keep each backend's median busy share of the stage and its highest peak. The devops review benchmark table gains a column, e.g. vllm 60% ×4, ollama-0 10% ×1. Saved summaries carry the fields, so Evaluation history, comparison and regression checks #555's comparisons can read them.
  • Direct model requests report their duration to the spend ledger's observers, as gateway calls do.
  • Moved to LLM serving and GPU metrics in Prometheus #546: the pool's busy share over a window, from Prometheus. It reads the vLLM, gateway and GPU metrics that LLM serving and GPU metrics in Prometheus #546 adds. The issue, roadmap and task file are updated.

Tests

tests/test_review_backend_activity.py covers:

  • union and overlap;
  • back-to-back calls;
  • per-stage timelines;
  • medians and peaks;
  • the busy-share cap;
  • the benchmark table;
  • direct request durations.

uv run devops ci --force: 13/13 gates pass.

Closes #557

…ew profiles

Profiles counted calls per backend, not how long each backend was busy or
how many calls it had in flight, so a benchmark could not show whether a
routing change spread the load across the LLM pool.

The profiler places each served call on its backend's timeline from the
call's duration, and each stage records per backend the calls, busy
seconds (their union), call seconds and peak concurrency. Benchmark
summaries keep each backend's median busy share and peak, and the
benchmark table shows them. Direct model requests now report their
duration. The pool's busy share over a window moves to #546, whose
metrics it reads.

Closes #557
@dan-petty dan-petty added this to the v0.2.23 milestone Sep 25, 2026
@dan-petty dan-petty added type/feature Type feature: a new function scope/ai AI review pipeline, personas, prompts, LLM client, or RAG priority/p1-high Priority P1: high-impact work for the next planned milestone labels Sep 25, 2026
@dan-petty
dan-petty enabled auto-merge (squash) September 25, 2026 02:11
…ackend-activity

# Conflicts:
#	docs/ROADMAP.md
@dan-petty
dan-petty merged commit 1214a71 into release/v0.2.23 Sep 25, 2026
7 checks passed
@dan-petty
dan-petty deleted the feat/557-backend-activity branch September 25, 2026 02:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority/p1-high Priority P1: high-impact work for the next planned milestone scope/ai AI review pipeline, personas, prompts, LLM client, or RAG type/feature Type feature: a new function

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant