incubator-tashi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mry...@apache.org
Subject svn commit: r781811 - /incubator/tashi/trunk/src/tashi/nodemanager/vmcontrol/qemu.py
Date Thu, 04 Jun 2009 17:53:41 GMT
Author: mryan3
Date: Thu Jun  4 17:53:41 2009
New Revision: 781811

URL: http://svn.apache.org/viewvc?rev=781811&view=rev
Log:
Fixed a bug in qemu backend statsThread function where uninitialized variables can cause value
spikes.


Modified:
    incubator/tashi/trunk/src/tashi/nodemanager/vmcontrol/qemu.py

Modified: incubator/tashi/trunk/src/tashi/nodemanager/vmcontrol/qemu.py
URL: http://svn.apache.org/viewvc/incubator/tashi/trunk/src/tashi/nodemanager/vmcontrol/qemu.py?rev=781811&r1=781810&r2=781811&view=diff
==============================================================================
--- incubator/tashi/trunk/src/tashi/nodemanager/vmcontrol/qemu.py (original)
+++ incubator/tashi/trunk/src/tashi/nodemanager/vmcontrol/qemu.py Thu Jun  4 17:53:41 2009
@@ -591,9 +591,9 @@
 						(dev, sep, ld) = stringPartition(l, ":")
 						dev = dev.strip()
 						ws = ld.split()
-						(recvMBs, sendMBs, lastRecvBytes, lastSendBytes) = netStats.get(dev, (0.0, 0.0, 0.0,
0.0))
 						recvBytes = float(ws[0])
 						sendBytes = float(ws[8])
+						(recvMBs, sendMBs, lastRecvBytes, lastSendBytes) = netStats.get(dev, (0.0, 0.0, recvBytes,
sendBytes))
 						if (recvBytes < lastRecvBytes):
 							if (lastRecvBytes > 2**32):
 								lastRecvBytes = lastRecvBytes - 2**64
@@ -618,7 +618,7 @@
 					vsize = (int(ws[22]))/1024.0/1024.0
 					rss = (int(ws[23])*4096)/1024.0/1024.0
 					cpuSeconds = myTicks/ticksPerSecond
-					lastCpuSeconds = cpuStats.get(vmId, 0.0)
+					lastCpuSeconds = cpuStats.get(vmId, cpuSeconds)
 					cpuLoad = (cpuSeconds - lastCpuSeconds)/(now - last)
 					cpuStats[vmId] = cpuSeconds
 					child = self.controlledVMs[vmId]



Mime
View raw message