add multi-mode reduction, percentiles, and log comparison to log_parser - #398
Merged
Jacob-Chmura merged 2 commits intoMar 20, 2026
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Jacob-Chmura
left a comment
Member
There was a problem hiding this comment.
Great contribution. We can at some point update the CI script to properly diff integration test runs using this logic.
Triggering a small integration test to check parsing
| MetricSummary with count, mean, std, min, max, and optional percentiles. | ||
| """ | ||
| n = len(values) | ||
| mean = sum(values) / n |
Member
There was a problem hiding this comment.
Suggested change
| mean = sum(values) / n | |
| mean = statistics.mean(values) if n > 1 else 0.0 |
Comment on lines
+98
to
+101
| idx = (p / 100.0) * (n - 1) | ||
| lo = int(idx) | ||
| hi = min(lo + 1, n - 1) | ||
| pct[f'p{p:g}'] = sorted_vals[lo] + (sorted_vals[hi] - sorted_vals[lo]) * (idx - lo) |
Jacob-Chmura
approved these changes
Mar 16, 2026
Jacob-Chmura
left a comment
Member
There was a problem hiding this comment.
Approving to unblock, just try to run the ruff formatter before merging.
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.
Summary / Description
The log parser only did mean reduction and had no way to compare runs. Added a
MetricSummarydataclass, acompute_summaryfn for full stats (count, mean, std, min, max, configurable percentiles), and areduce_metricsfn that supports mean/median/min/max/last/full strategies. Also addedcompare_logswhich diffs two log files side by side and reports absolute and relative deltas per metric.collect_raw_metricssplits out the file reading from reduction so both pieces are testable independently.parse_log_fileis kept as a thin wrapper for backward compat. CLI gets three new args:--reduction,--percentiles, and--compare.Related Issues: #
Type of Change
Test Evidence
Manual testing with existing log files. The old default behavior (mean reduction, no comparison) is unchanged.
Questions / Discussion Points
The percentile interpolation uses linear interp between adjacent sorted values, same approach as numpy percentile with
interpolation='linear'. Open to switching to a different method if there is a project preference.