Skip to content

fix: swapped Max/Min for timing fields - #342

Open
farron65 wants to merge 1 commit into
rakyll:masterfrom
farron65:fix-max-min-swap
Open

fix: swapped Max/Min for timing fields#342
farron65 wants to merge 1 commit into
rakyll:masterfrom
farron65:fix-max-min-swap

Conversation

@farron65

@farron65 farron65 commented Aug 5, 2026

Copy link
Copy Markdown

sort.Float64s sorts ascending, so index 0 is the min and index len-1 is the max. The snapshot() assignments in report.go had ConnMax/DnsMax/ReqMax/DelayMax/ResMax reading from index 0 (the min) and their Min counterparts reading from index len-1 (the max).

Fixing the assignment alone would have broken the CLI output, since print.go's Details template prints these fields under the header (average, fastest, slowest) and relied on the old (backwards) values landing in the right position by coincidence. Swapped the corresponding variables in the template so both files now agree.

Verified before/after with:
hey -n 50 -c 5 -disable-keepalive
fastest/slowest columns are now correctly ordered after the fix.

sort.Float64s sorts ascending, so index 0 is the min and index
len-1 is the max. The snapshot() assignments in report.go had
ConnMax/DnsMax/ReqMax/DelayMax/ResMax reading from index 0 (the
min) and their Min counterparts reading from index len-1 (the max).

Fixing the assignment alone would have broken the CLI output, since
print.go's Details template prints these fields under the header
(average, fastest, slowest) and relied on the old (backwards)
values landing in the right position by coincidence. Swapped the
corresponding variables in the template so both files now agree.

Verified before/after with:
  hey -n 50 -c 5 -disable-keepalive <url>
fastest/slowest columns are now correctly ordered after the fix.
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.

1 participant