diff --git a/pkg/report/timeseries.go b/pkg/report/timeseries.go index 2005ee5e36a..6f5ed8c4a54 100644 --- a/pkg/report/timeseries.go +++ b/pkg/report/timeseries.go @@ -64,9 +64,9 @@ func (sp *secondPoints) Add(ts time.Time, lat time.Duration) { sp.tm[tk] = secondPoint{minLatency: lat, maxLatency: lat, totalLatency: lat, count: 1} } else { if lat != time.Duration(0) { - v.minLatency = minDuration(v.minLatency, lat) + v.minLatency = min(v.minLatency, lat) } - v.maxLatency = maxDuration(v.maxLatency, lat) + v.maxLatency = max(v.maxLatency, lat) v.totalLatency += lat v.count++ sp.tm[tk] = v @@ -144,17 +144,3 @@ func (t TimeSeries) String() string { } return fmt.Sprintf("\nSample in one second (unix latency throughput):\n%s", buf.String()) } - -func minDuration(a, b time.Duration) time.Duration { - if a < b { - return a - } - return b -} - -func maxDuration(a, b time.Duration) time.Duration { - if a > b { - return a - } - return b -}