Skip to content

Fix median duration for even run counts - #25

Merged
royalpinto007 merged 1 commit into
AgentPostmortem:mainfrom
Gambit-Checkmate:fix/stats-median
Sep 6, 2026
Merged

Fix median duration for even run counts#25
royalpinto007 merged 1 commit into
AgentPostmortem:mainfrom
Gambit-Checkmate:fix/stats-median

Conversation

@Gambit-Checkmate

Copy link
Copy Markdown
Contributor

agentrace stats selected the upper middle duration for even-sized samples, reporting 20 s for runs lasting 10 s and 20 s. Use statistics.median so this reports 15 s instead, retaining the existing whole-second display.

Add output-level regression coverage for even and odd counts, a single duration, missing timestamps, and no known durations. The two even-count cases failed with the original implementation before the fix.

Closes #23.

Validation: all 28 tests pass; Ruff lint and formatting checks pass for both modified files; git diff --check passes. Repository-wide Ruff also reports pre-existing diagnostics in untouched files.

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown

Welcome, @Gambit-Checkmate, and thanks for your first pull request to Agentrace.

A quick look at CONTRIBUTING.md covers how things are set up and run here.

I'll review this shortly. Ask anything in the thread if something is unclear.

@royalpinto007
royalpinto007 merged commit cdf00a5 into AgentPostmortem:main Sep 6, 2026
8 checks passed
@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown

Merged. Thanks a lot, @Gambit-Checkmate.

Genuinely helpful change for Agentrace.

If this project helps you out, a star helps others find it too.

Happy to see more from you whenever you have the time.

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.

Median run is the upper middle for even counts, not the median

2 participants