Skip to content

armgit / hey

Public Imported from GitHub
0

HTTP load generator, ApacheBench (ab) replacement

Go

histogram: calculate lengths using round-to-nearest

Sina Siadate30f468b50f6
diff --git a/requester/print.go b/requester/print.go
index 3e9af38..3d2d521 100644
--- a/requester/print.go
+++ b/requester/print.go
@@ -194,7 +194,7 @@ func (r *report) printHistogram() {
// Normalize bar lengths.
var barLen int
if max > 0 {
- barLen = counts[i] * 40 / max
+ barLen = (counts[i]*40 + max/2) / max
}
fmt.Printf(" %4.3f [%v]\t|%v\n", buckets[i], counts[i], strings.Repeat(barChar, barLen))
}