Skip to content

Commit

Permalink
fix: adjust total count in loadgen example (#562)
Browse files Browse the repository at this point in the history
The previous commit had a typo where we double counted unavailable
instead of adding limit exceeded.
  • Loading branch information
malandis authored Nov 26, 2024
1 parent be8848f commit d8bd37c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/loadgen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func worker(
}

func printStats(gets *hdrhistogram.Histogram, sets *hdrhistogram.Histogram, errorCounter ErrorCounter, startTime time.Duration) {
totalRequests := gets.TotalCount() + sets.TotalCount() + errorCounter.timeout + errorCounter.unavailable + errorCounter.unavailable
totalRequests := gets.TotalCount() + sets.TotalCount() + errorCounter.timeout + errorCounter.unavailable + errorCounter.limitExceeded
totalTps := int(math.Round(
float64(totalRequests * 1000 / hrtime.Since(startTime).Milliseconds()),
))
Expand Down

0 comments on commit d8bd37c

Please sign in to comment.