Skip to content

feat: Add -e/--extended-errors flag for detailed HTTP status code breakdown - #263

Open
salmaaliia wants to merge 3 commits into
JoeDog:masterfrom
salmaaliia:feature/extended-errors
Open

salmaaliia wants to merge 3 commits into
JoeDog:masterfrom
salmaaliia:feature/extended-errors

Conversation

@salmaaliia

Copy link
Copy Markdown

This PR adds a new -e, --extended-errors flag to provide visibility into specific HTTP error status codes:

  • Track all 4xx and 5xx HTTP response status codes per worker using a lightweight, lock-free error map.
  • Aggregate and display a sorted breakdown of each error code in both standard summary and JSON output modes.

…akdown

* Track all 4xx and 5xx HTTP response status codes per worker using a lightweight, lock-free error map.
* Aggregate and display a sorted breakdown of each error code in both standard summary and JSON output modes.
@JoeDog

JoeDog commented Sep 29, 2026

Copy link
Copy Markdown
Owner

Got it, I'll take a look soon. Thanks.

@salmaaliia

Copy link
Copy Markdown
Author

Thanks!
I just want to mention that Failed transactions still only counts 5xx, so the -e list will show more errors since it includes 4xx too. Didn't want to touch the original counter.

@JoeDog

JoeDog commented Sep 30, 2026

Copy link
Copy Markdown
Owner

Could you post some expected outouts with -e enabled? I'd like to see expected behavior.

@salmaaliia

Copy link
Copy Markdown
Author

Sure! Here is what the output looks like with -e enabled, for both standard and JSON mode:

Standard output (siege -e ...):

Transactions:		       94    hits
Availability:		       94.00 %
Elapsed time:		        0.02 secs
Data transferred:	        0.00 MB
Response time:		        0.96 ms
Transaction rate:	     4700.00 trans/sec
Throughput:		        0.12 MB/sec
Concurrency:		        4.50
Successful transactions:       72
Failed transactions:	        6
  HTTP-404:		        8
  HTTP-429:		       14
  HTTP-500:		        5
  HTTP-503:		        1
Longest transaction:	       10.00 ms
Shortest transaction:	        0.00 ms

JSON output (siege -e -j ...):

{
	"transactions":			          98,
	"availability":			       98.00,
	"elapsed_time":			        0.02,
	"data_transferred":		        0.00,
	"response_time":		        0.00,
	"transaction_rate":		     4900.00,
	"throughput":			        0.12,
	"concurrency":			        3.50,
	"successful_transactions":	          85,
	"failed_transactions":		           2,
	"longest_transaction":		        0.01,
	"shortest_transaction":		        0.00,
	"extended_errors": {
		"HTTP-404":		          11,
		"HTTP-429":		           2,
		"HTTP-500":		           2
	}
}

@JoeDog

JoeDog commented Sep 30, 2026

Copy link
Copy Markdown
Owner

Thanks, I'll set up a page that returns random error codes. It doesn't appear that you're accumulating 3xx returns.

@salmaaliia

Copy link
Copy Markdown
Author

Yes, it only counts 4xx and 5xx since 3xx are redirects rather than errors. Do you think 3xx should be included too?

@JoeDog

JoeDog commented Sep 30, 2026

Copy link
Copy Markdown
Owner

I'm not sure about 3xx.

We already collect pass/fail information in the general summary. This could be a breakdown of all HTTP codes, in which case 3xx should be included. For that matter, 2xx should be included as weel.

On the other hand, if all we care about are HTTP codes for errors, then 4xx, 5xx meet that requirement. What are your thoughts?

@salmaaliia

Copy link
Copy Markdown
Author

I think we can have -e ("extended") report all codes (2xx, 3xx, 4xx, 5xx).
We could also use -ee ("extended errors") for errors only if someone just wants 4xx/5xx. What do you think?

@JoeDog

JoeDog commented Sep 30, 2026

Copy link
Copy Markdown
Owner

I like it. Do you want to update it, or should I?

-ee is a little tricky; it's the short option with e as an argument. Maybe do it without the short options

--extended
--extended-errors

These are examples with no short option
--no-parser NO PARSER, turn off the HTML page parser
--no-follow NO FOLLOW, do not follow HTTP redirects

@salmaaliia

Copy link
Copy Markdown
Author

I will update it, thank you!

…akdown

* Track all HTTP response codes with --extended and errors only with --extended-errors.
* Display sorted breakdown at the end of summary output and structured in JSON mode.
@salmaaliia

Copy link
Copy Markdown
Author

Just pushed the update with --extended and --extended-errors as long-only options, and moved the output to the bottom.

here is how the output looks like for siege --extended

Successful transactions:       73
Failed transactions:	        7
Longest transaction:	       10.00 ms
Shortest transaction:	        0.00 ms
HTTP response codes:
  HTTP-200:		       73
  HTTP-404:		        9
  HTTP-429:		       11
  HTTP-500:		        3
  HTTP-503:		        4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants