From 45255bccb360e4bd50b2c71d85679c630561be8e Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Mon, 12 Jun 2023 17:42:29 +0100 Subject: [PATCH] accounting: fix Prometheus metrics to be the same as core/stats In 04aa6969a4751664 we updated the displayed speed to be a rolling average in core/stats and the progress output but we didn't update the Prometheus metrics. This patch updates the Prometheus metrics too. Fixes #7053 --- fs/accounting/stats.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/fs/accounting/stats.go b/fs/accounting/stats.go index 358cf4a6f..7e3a07225 100644 --- a/fs/accounting/stats.go +++ b/fs/accounting/stats.go @@ -135,13 +135,7 @@ func (s *StatsInfo) RemoteStats() (out rc.Params, err error) { // // Call with lock held func (s *StatsInfo) speed() float64 { - dt := s.totalDuration() - dtSeconds := dt.Seconds() - speed := 0.0 - if dt > 0 { - speed = float64(s.bytes) / dtSeconds - } - return speed + return s.average.speed } // timeRange is a start and end time of a transfer