The Xen CPU data collector gets as raw data accumulated CPU usage since an arbitrary start date. If the value gets too large, the counter rolls over. The XenCpuLoad collector is aware of this happening and adjusts the observed values accordingly. However, the condition for detecting a rollover was wrong: on an rollover, the value strictly goes down. The value can stay the same over an interval, e.g., for very idle guests; not that the accuracy of the reported accumulated value can be as coarse as a whole CPU second.
Signed-off-by: Klaus Aehlig <[email protected]> --- src/Ganeti/DataCollectors/XenCpuLoad.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ganeti/DataCollectors/XenCpuLoad.hs b/src/Ganeti/DataCollectors/XenCpuLoad.hs index 2a66513..10c39cd 100644 --- a/src/Ganeti/DataCollectors/XenCpuLoad.hs +++ b/src/Ganeti/DataCollectors/XenCpuLoad.hs @@ -115,7 +115,7 @@ combineWithRollover new old | Seq.null new || Seq.null old = new Seq.>< old combineWithRollover new old = let (t2, x2) = Seq.index new $ Seq.length new - 1 (t1, x1) = Seq.index old 0 - in if x2 > x1 + in if x2 >= x1 then new Seq.>< old else let delta_t = diffClockTimes t2 t1 deltax = x2 - x1 -- 2.5.0.rc2.392.g76e840b
