mirror of
https://github.com/rclone/rclone.git
synced 2024-11-22 16:34:30 +01:00
accounting: fix Prometheus metrics to be the same as core/stats
In 04aa6969a4
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
This commit is contained in:
parent
055206c4ee
commit
45255bccb3
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user