Repository navigation
feat(benchmark): net out retried attempts by trial id in task-level routing stats - #120
Merged
Merged
Conversation
Contributor
WalkthroughChangesRouting accounting
Estimated code review effort: 4 (Complex) | ~45 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Comment |
ryan-lempka
marked this pull request as draft
July 23, 2026 04:21
…outing stats Signed-off-by: Ryan Lempka <rlempka@nvidia.com>
ryan-lempka
force-pushed
the
rlempka/routing-log-retry-netting
branch
from
July 23, 2026 04:40
9d216e5 to
78c6ab8
Compare
ryan-lempka
marked this pull request as ready for review
July 23, 2026 04:41
ayushag-nv
approved these changes
Jul 23, 2026
ayushag-nv
left a comment
Contributor
There was a problem hiding this comment.
Looks good. Aligned with what I was trying to do with logging per request routing decisions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extends the task-level routing stats (#116) so retried attempts can be netted out of cost, plus a token schema that matches the global stats file.
What changed
x-switchyard-trial-id(Harbor's trial name, read from the container env) alongside the existing task and session headers. At finalize, requests are grouped by trial, and within a trial the latest attempt is the one Harbor kept (it retries sequentially and discards earlier attempts). So tokens from retried-away attempts land in aretriessection and can be subtracted. No timestamps, no result.json parsing.cached_tokens,cache_creation_tokens, andreasoning_tokensalongside prompt/completion/total, matchingrouting_stats_final.jsonso the existing cost estimator prices either file.modelis the served model id, so buckets reconcile with the global file.Schema, before → after (per task in
routing_stats_by_task.json):finalandretriesshare the same shape, so the cost estimator runs on either: net cost = price(final), retry overhead = price(retries).Tested end to end: Ran a real Harbor benchmark, forced a task to time out and retry, and confirmed the stamped trial id matches Harbor's trial name and that the retried attempt's tokens land in
retrieswhile the kept attempt's stay infinal.