mirror of
https://github.com/ClusterCockpit/cc-metric-collector.git
synced 2026-02-13 14:41:45 +01:00
Fix derivative values should be float
This commit is contained in:
@@ -618,13 +618,13 @@ func (m *GpfsCollector) Read(interval time.Duration, output chan lp.CCMessage) {
|
|||||||
case "derivative":
|
case "derivative":
|
||||||
if vnew_ok && vold_ok && timeDiff > 0 {
|
if vnew_ok && vold_ok && timeDiff > 0 {
|
||||||
value = float64(vnew-vold) / timeDiff
|
value = float64(vnew-vold) / timeDiff
|
||||||
if value.(float64) < 0 {
|
if value.(float64) < 0.0 {
|
||||||
value = 0
|
value = 0.0
|
||||||
}
|
}
|
||||||
value_ok = true
|
value_ok = true
|
||||||
} else if vold_ok {
|
} else if vold_ok {
|
||||||
// if the difference is not computable, return 0
|
// if the difference is not computable, return 0
|
||||||
value = 0
|
value = 0.0
|
||||||
value_ok = true
|
value_ok = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user