mirror of
https://github.com/rclone/rclone.git
synced 2025-06-24 22:11:45 +02:00
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
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
|
// Call with lock held
|
||||||
func (s *StatsInfo) speed() float64 {
|
func (s *StatsInfo) speed() float64 {
|
||||||
dt := s.totalDuration()
|
return s.average.speed
|
||||||
dtSeconds := dt.Seconds()
|
|
||||||
speed := 0.0
|
|
||||||
if dt > 0 {
|
|
||||||
speed = float64(s.bytes) / dtSeconds
|
|
||||||
}
|
|
||||||
return speed
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// timeRange is a start and end time of a transfer
|
// timeRange is a start and end time of a transfer
|
||||||
|
Loading…
x
Reference in New Issue
Block a user