fix: handle JMH throughput metrics as bigger-is-better - #366
fix: handle JMH throughput metrics as bigger-is-better#366lixiaoyong01 wants to merge 2 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughJMH ratio calculation now derives alert direction from each result unit. Throughput results use higher-is-better logic, while time results retain lower-is-better logic. A test covers both result types in one alert. ChangesJMH alert direction
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This PR corrects comparison direction for JMH throughput metrics while preserving time-based behavior, with tests covering the mixed-metric cases; no actionable merge-blocking risk remains after normal checks and review. 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Full details: Linked Issues checkExplanation The implementation derives JMH comparison direction from the result unit. Units beginning with "ops/" are treated as bigger-is-better, while other JMH units retain smaller-is-better behavior. The added test covers both throughput and time metrics required by issue ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
JMH can report both throughput metrics (for example,
ops/s) andtime-per-operation metrics (for example,
ns/op) in the same benchmarksuite. The action previously treated all JMH results as smaller-is-better,
which inverted alert direction for throughput metrics.
This change derives the comparison direction from each result's unit:
ops/...units are treated as bigger-is-better.Fixes #365.
Tests
npm test -- --runInBandThe full suite passed locally: 235/235 tests on this branch. The two added
tests cover the mixed JMH throughput/time case for both GitHub.com and
GitHub Enterprise Server test configurations.
Summary by CodeRabbit
Bug Fixes
Tests