Skip to content

Commit 564f9c2

Browse files
committed
tweak error results
1 parent 89f5665 commit 564f9c2

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

interfaces/basic.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ import (
1919
"strings"
2020
"time"
2121

22+
"github.com/mercadolibre/pla/boomer"
2223
"github.com/sschepens/gohistogram"
2324
"github.com/sschepens/pb"
24-
"github.com/mercadolibre/pla/boomer"
2525
)
2626

2727
const (
@@ -136,13 +136,16 @@ func (b *BasicInterface) print() {
136136
fmt.Printf(" Response Size per Request:\t%d bytes.\n", b.sizeTotal/int64(b.histo.Count()))
137137
}
138138
b.printStatusCodes()
139-
b.printHistogram()
140-
b.printLatencies()
141139
}
142140

143141
if len(b.errorDist) > 0 {
144142
b.printErrors()
145143
}
144+
145+
if b.histo.Count() > 0 {
146+
b.printHistogram()
147+
b.printLatencies()
148+
}
146149
}
147150

148151
// Prints percentile latencies.
@@ -188,6 +191,6 @@ func (b *BasicInterface) printStatusCodes() {
188191
func (b *BasicInterface) printErrors() {
189192
fmt.Printf("\nError distribution:\n")
190193
for err, num := range b.errorDist {
191-
fmt.Printf(" [%d]\t%s\n", num, err)
194+
fmt.Printf(" [%s]\t%d occurrences\n", err, num)
192195
}
193196
}

0 commit comments

Comments
 (0)