Navigation Menu

Skip to content

Commit

Permalink
go-memcached-bench: handle the case when all requests were unsuccessful
Browse files Browse the repository at this point in the history
  • Loading branch information
valyala committed Mar 7, 2014
1 parent 7b9c773 commit 6b5b7e0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions apps/go/memcached-bench/main.go
Expand Up @@ -115,6 +115,10 @@ func printStats(stats []Stats, startTime *time.Time) {
for i := 0; i < n; i++ {
totalRequestsCount += totalStats.responseTimeHistogram[i]
}
if totalRequestsCount == 0 {
fmt.Printf("There are no successful requests performed\n")
return
}

var avgResponseTime time.Duration
if totalRequestsCount > 0 {
Expand Down

0 comments on commit 6b5b7e0

Please sign in to comment.