[Pkg-ganeti-devel] [ganeti] 154/165: Fix rollover condition in xenload

Apollon Oikonomopoulos apoikos at moszumanska.debian.org
Tue Aug 11 13:53:23 UTC 2015


This is an automated email from the git hooks/post-receive script.

apoikos pushed a commit to branch master
in repository ganeti.

commit e2bac8e06be060876bb960935124d6d137fe57eb
Author: Klaus Aehlig <aehlig at google.com>
Date:   Fri Jul 24 13:25:25 2015 +0200

    Fix rollover condition in xenload
    
    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 <aehlig at google.com>
    Reviewed-by: Helga Velroyen <helgav at google.com>
---
 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

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ganeti/ganeti.git



More information about the Pkg-ganeti-devel mailing list