diff --git a/lib/metrics.go b/lib/metrics.go index bfca85e1..d5842cbc 100644 --- a/lib/metrics.go +++ b/lib/metrics.go @@ -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)