Skip to content

Commit

Permalink
metrics: Fix regression
Browse files Browse the repository at this point in the history
  • Loading branch information
tsenart committed Jan 12, 2020
1 parent 7146527 commit bd2bfbc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ func (m *Metrics) Add(r *Result) {
// Close implements the Close method of the Report interface by computing
// derived summary metrics which don't need to be run on every Add call.
func (m *Metrics) Close() {
m.init()

if m.Requests == 0 {
return
}

m.init()

m.Rate = float64(m.Requests)
m.Throughput = float64(m.success)
m.Duration = m.Latest.Sub(m.Earliest)
Expand Down

0 comments on commit bd2bfbc

Please sign in to comment.