-
Notifications
You must be signed in to change notification settings - Fork 77
Response Time Breakdowns by HTTP Status Code #663
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📋 Review Summary
This PR introduces a valuable feature for analyzing load test results by breaking down response times by status code. The implementation is well-tested and the documentation is clear.
🔍 General Feedback
- The code is generally well-written and the new feature is a great addition.
- The integration tests are comprehensive and cover various scenarios.
- I've left a few minor suggestions to improve code maintainability and robustness.
Great work on this feature!
LionsAd
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Review: Response Time Breakdowns by HTTP Status Code (#663)
🎯 Core Assessment
This is a valuable feature with a solid implementation that provides real diagnostic benefits. The concerns raised are legitimate but represent different levels of priority and business tradeoffs.
📋 Recommendations by Category
🔧 Technical Improvements (If Time Permits)
Memory Optimization
- Problem: Storing duplicate timing data per status code
- Options:
- Add config flag to disable feature for high-RPS scenarios
- Use aggregate stats only (min/max/count) instead of full vectors
- Document the memory tradeoff in user docs
- Business Reality: Most load tests have reasonable request volumes where this won't matter
API Design Consideration
- Problem: Adding public field to public struct
- Options:
- Make field
pub(crate)with accessor methods - Accept as minor version bump (common in ecosystem)
- Add
#[non_exhaustive]for future flexibility
- Make field
- Business Reality: Many Rust crates evolve public structs this way
🧪 Test Reliability (Quick Wins)
Mock Determinism
- Problem: httpmock behavior isn't guaranteed to hit all mocks
- Solution: Use stateful mocking or explicit ratios
- Effort: Low - just restructure existing test setup
Edge Case Safety
- Problem: Empty vectors in median calculation
- Solution: Add guard clauses or verify
util::medianhandles empty input - Effort: Very low - add a few safety checks
🎨 Polish (Nice to Have)
HTML Accessibility
- Problem: Hardcoded background color
- Solution: Use CSS variables or classes
- Business Reality: Current approach works fine, this is enhancement
Code Style
- Problem: Clippy warnings
- Solution: Run
cargo clippy --fix - Effort: Literally automatic
(Powered by Claude Code)
|
Here is the clippy diff - it must be my version, which is still overly pedantic, but I also find it easier to read: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RTBM - with some concerns raised by the code review
I leave it to your discretion if you want to implement them or not or want to create follow-up issues.
LIkely you need to update your local version of Rust and related tools. https://github.com/rust-lang/rust-clippy/blob/master/CHANGELOG.md The |
Summary
This PR implements response time breakdowns grouped by HTTP status code in Goose's CLI and HTML/PDF reports, providing valuable performance insights for load testing analysis.
Closes #528
What's New
When a request returns multiple different HTTP status codes during a load test, Goose now automatically provides response time breakdowns grouped by status code. This feature uses smart omission - breakdowns only appear when multiple status codes exist, preventing unnecessary clutter.
CLI Output Example
This breakdown reveals that 404 responses took longer on average (7.24ms) than successful 200 responses (4.98ms), helping identify performance patterns related to error handling.
HTML Report Integration
The feature is fully integrated into HTML and PDF reports with professional formatting:
Technical Implementation
Files Modified
src/metrics.rs: Core tracking infrastructuresrc/metrics/common.rs: HTML report generationsrc/report.rs: Professional HTML formattingtests/status_code_response_times.rs: Comprehensive test coveragesrc/docs/goose-book/src/getting-started/metrics.md: Updated documentationBenefits