fix: return total_duration instead of average_duration in report_costs summary #333
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.
Summary
This PR fixes issue #332 by changing the
report_costs.pysummary to returntotal_durationinstead ofaverage_duration.Changes
calculate_time_statisticsto includetotal_duration(sum of all durations) in addition to existing statisticscalculate_coststo tracktotal_durationacross all JSONL files (main output and critic files)total_durationinstead ofaverage_durationreport_costs.pyfunctionalityDetails
The
total_durationis calculated as the sum of all instance durations across all JSONL files, similar to howtotal_costis calculated. When critic files exist, the total duration is the sum of durations from all critic files; otherwise, it falls back to the main output file's total duration.Testing
Added 11 new tests in
tests/test_report_costs.pycovering:calculate_time_statisticsreturningtotal_durationcalculate_line_durationfunctionalityextract_accumulated_costfunctionalitytotal_durationwith and without critic filesAll tests pass.
Fixes #332
@juanmichelini can click here to continue refining the PR