mirror of
https://github.com/grafana/grafana.git
synced 2024-12-02 05:29:42 -06:00
12 lines
225 B
Go
12 lines
225 B
Go
|
package metrics
|
||
|
|
||
|
import "math"
|
||
|
|
||
|
func calculateDelta(oldValue, newValue int64) int64 {
|
||
|
if oldValue < newValue {
|
||
|
return newValue - oldValue
|
||
|
} else {
|
||
|
return (math.MaxInt64 - oldValue) + (newValue - math.MinInt64) + 1
|
||
|
}
|
||
|
}
|