Skip to content

perf: skip unused live metric computations - #53

Merged
cquil11 merged 3 commits into
masterfrom
cam/skip-live-request-timeslices
Oct 14, 2026
Merged

cquil11 merged 3 commits into
masterfrom
cam/skip-live-request-timeslices

Conversation

@cquil11

@cquil11 cquil11 commented Oct 14, 2026 •

Copy link
Copy Markdown

Live metric updates rebuild per-second request statistics that the live consumer discards. AgentX also builds sweep curves for 14 metrics absent from its ordinary progress log. Both calculations block record ingestion while they run.

Reserve request timeslices for final exports. For the agentx scenario with a non-dashboard UI, also skip sweep curves during live summaries. Interactive dashboards, other scenarios' sweep metrics, and final reports retain the full calculations. No new user-facing setting is added.

AgentX progress-log values and server-metric time series are unchanged. Non-dashboard AgentX realtime metric messages, including those consumed by live API subscribers, omit the 14 sweep metrics; final exports still contain them.


Note

Medium Risk
Changes live metric payloads for non-dashboard AgentX (14 fewer sweep tags in realtime/API) while altering the hot summarize path; final exports and dashboard behavior are preserved by design.

Overview
Live request-metric updates no longer compute per-timeslice buckets or, in some AgentX runs, sweep curves. MetricsAccumulator.summarize() now passes include_timeslices=False into _summarize_for_export_context, so rolling dashboards and progress logs only get overall aggregates; timeslicing stays on export_results() for final exports and plots.

For agentx with a non-dashboard UI, live summaries also set include_sweeps=False, skipping the 14 effective/active sweep metrics that the ordinary progress log does not display. Dashboard AgentX, other scenarios, and all final exports still run full sweep and timeslice work. Architecture docs and AccumulatorMetricsSummary docstrings describe this split.

Unit tests that asserted timeslice behavior now call export_results(ExportContext()) instead of summarize(). A new realtime test patches _compute_timeslices / compute_sweep_curves to prove the live path skips that work while export output stays unchanged.

Reviewed by Cursor Bugbot for commit 234bed1. Bugbot is set up for automated code reviews on this repo. Configure here.

Signed-off-by: Cam Quilici <cjquilici@gmail.com>
@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Try out this PR

Quick install:

pip install --upgrade --force-reinstall git+https://github.com/ai-dynamo/aiperf.git@234bed113ddfa7753b2a3125af35f6aa966e0c78

Recommended with virtual environment (using uv):

uv venv --python 3.12 && source .venv/bin/activate
uv pip install --upgrade --force-reinstall git+https://github.com/ai-dynamo/aiperf.git@234bed113ddfa7753b2a3125af35f6aa966e0c78

Last updated for commit: 234bed1 • Browse code

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Fern Docs Preview: generation failed — see the Actions log for details. This does not block merge; ask a maintainer to retry if needed.

Signed-off-by: Cam Quilici <cjquilici@gmail.com>
@cquil11 cquil11 changed the title Skip unused request timeslices in live metric updates Avoid unused live metric calculations and AgentX sweep curves Oct 14, 2026
Signed-off-by: Cam Quilici <cjquilici@gmail.com>
@cquil11 cquil11 changed the title Avoid unused live metric calculations and AgentX sweep curves perf: skip unused live metric computations Oct 14, 2026
@github-actions github-actions Bot added the perf label Oct 14, 2026
@cquil11
cquil11 merged commit 7a2bb00 into master Oct 14, 2026
26 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant