incubator-tashi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mry...@apache.org
Subject svn commit: r818206 - /incubator/tashi/trunk/src/tashi/nodemanager/vmcontrol/qemu.py
Date Wed, 23 Sep 2009 19:01:47 GMT
Author: mryan3
Date: Wed Sep 23 19:01:46 2009
New Revision: 818206

URL: http://svn.apache.org/viewvc?rev=818206&view=rev
Log:
Collect additional VM stats (virtual block devices)


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=818206&r1=818205&r2=818206&view=diff
==============================================================================
--- incubator/tashi/trunk/src/tashi/nodemanager/vmcontrol/qemu.py (original)
+++ incubator/tashi/trunk/src/tashi/nodemanager/vmcontrol/qemu.py Wed Sep 23 19:01:46 2009
@@ -628,6 +628,17 @@
 						(tmpRecvMBs, tmpSendMBs, tmpRecvBytes, tmpSendBytes) = netStats.get(netDev, (0.0, 0.0,
0.0, 0.0))
 						(recvMBs, sendMBs, recvBytes, sendBytes) = (recvMBs + tmpRecvMBs, sendMBs + tmpSendMBs,
recvBytes + tmpRecvBytes, sendBytes + tmpSendBytes)
 					self.stats[vmId] = self.stats.get(vmId, {})
+					child = self.controlledVMs.get(vmId, None)
+					if (child):
+						res = self.enterCommand(child, "info blockstats")
+						for l in res.split("\n"):
+							(device, sep, data) = stringPartition(l, ": ")
+							if (data != ""):
+								for field in data.split(" "):
+									(label, sep, val) = stringPartition(field, "=")
+									if (val != ""):
+										self.stats[vmId]['%s_%s_per_s' % (device, label)] = (float(val) - float(self.stats[vmId].get('%s_%s'
% (device, label), 0)))/self.statsInterval
+										self.stats[vmId]['%s_%s' % (device, label)] = int(val)
 					self.stats[vmId]['cpuLoad'] = cpuLoad
 					self.stats[vmId]['rss'] = rss
 					self.stats[vmId]['recvMBs'] = sendMBs



Mime
View raw message