bombardier: add counts for each status code received#125
Open
eusebiu-boghici wants to merge 1 commit intocodesenberg:masterfrom
Open
bombardier: add counts for each status code received#125eusebiu-boghici wants to merge 1 commit intocodesenberg:masterfrom
eusebiu-boghici wants to merge 1 commit intocodesenberg:masterfrom
Conversation
Display number of requests for each status code received. Instead of having just 4xx, now you can see how many 404 and 429 were received.
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.
Thank you for this project!
This PR adds a new
--detailedflag tobombardier. When enabled, the output (both plain-text and JSON) will include a breakdown of every unique HTTP status code received during the test. (related to #93 (comment))Motivation and Context
Currently,
bombardieraggregates status codes into1xx,2xx,3xx,4xx, and5xxbuckets. This aggregation hides important details, such as distinguishing between400 Bad Requestand429 Too Many Requests. This feature allows users to see the exact count for each status code, providing better visibility into server behavior, especially during load testing.Changes
1. New Flag:
--detailed--detailedboolean flag to the command-line arguments.2. Detailed Status Collection
reqNxxcounters in thebombardierstruct with amap[int]uint64namedstatusCodes, protected by async.Mutex.req1xx,req2xx, etc., aggregated fields are now computed dynamically from thestatusCodesmap during the reporting phase (gatherInfo). This ensures consistency between the detailed breakdown and the aggregate summaries.3. Output Updates
--detailedflag. If present, it prints a new "Detailed status codes" section, listing each code and its count in ascending order.--detailedflag. If present, it adds astatusCodesobject to theresultsection, mapping each status code to its count.Verification
Manual Testing
I verified the changes by running
bombardieragainsthttps://www.google.comwith and without the--detailedflag.Command:
Output:
JSON Output:
{ "spec": { ... }, "result": { ... "req1xx": 0, "req2xx": 1, ... "statusCodes": { "200": 1 }, ... } }Automated Tests
I updated
bombardier_test.goto reflect the internal refactoring (use ofgatherInfoinstead of direct field access) and confirmed that all tests pass.