atom feed37 messages in com.redhat.et-mgmt-toolsRe: [et-mgmt-tools] [PATCH 6/9]: virt...
FromSent OnAttachments
Guido GüntherOct 3, 2008 6:50 am.diff
Cole RobinsonOct 3, 2008 1:19 pm 
Guido GüntherOct 4, 2008 1:11 pm 
Guido GüntherOct 4, 2008 1:13 pm.patch
Guido GüntherOct 4, 2008 1:15 pm 
Guido GüntherOct 4, 2008 1:17 pm.patch
Guido GüntherOct 4, 2008 1:19 pm.patch
Guido GüntherOct 4, 2008 1:20 pm.patch
Guido GüntherOct 4, 2008 1:24 pm.patch
Guido GüntherOct 4, 2008 1:28 pm.patch
Guido GüntherOct 4, 2008 1:29 pm.patch
Guido GüntherOct 4, 2008 1:30 pm.patch
Daniel P. BerrangeOct 6, 2008 3:27 am 
Daniel P. BerrangeOct 6, 2008 3:28 am 
Daniel P. BerrangeOct 6, 2008 3:29 am 
Daniel P. BerrangeOct 6, 2008 3:33 am 
Daniel P. BerrangeOct 6, 2008 3:33 am 
Daniel P. BerrangeOct 6, 2008 3:37 am 
Daniel P. BerrangeOct 6, 2008 3:38 am 
Daniel P. BerrangeOct 6, 2008 4:04 am 
Daniel P. BerrangeOct 6, 2008 4:04 am 
Cole RobinsonOct 6, 2008 9:40 am 
Cole RobinsonOct 6, 2008 10:01 am 
Cole RobinsonOct 6, 2008 10:02 am 
Cole RobinsonOct 6, 2008 10:03 am 
Guido GüntherOct 7, 2008 6:11 am.patch
Guido GüntherOct 7, 2008 6:16 am.patch
Cole RobinsonOct 9, 2008 9:38 am 
Cole RobinsonOct 9, 2008 9:38 am 
Cole RobinsonOct 9, 2008 9:45 am 
Guido GüntherOct 18, 2008 12:49 pm 
Guido GüntherOct 18, 2008 12:49 pm.diff
Guido GüntherOct 18, 2008 12:50 pm.diff
Guido GüntherOct 18, 2008 12:50 pm.diff
Guido GüntherOct 18, 2008 12:51 pm.diff
Guido GüntherOct 18, 2008 12:51 pm.diff
Cole RobinsonOct 23, 2008 8:45 am 
Subject:Re: [et-mgmt-tools] [PATCH 6/9]: virt-manager: block device and network statistics
From:Daniel P. Berrange (berr@redhat.com)
Date:Oct 6, 2008 3:37:42 am
List:com.redhat.et-mgmt-tools

On Sat, Oct 04, 2008 at 10:24:25PM +0200, Guido G?nther wrote:

This is the actual patch to calculate the block and net stats:

Display block device I/0 and network I/O in the overview as well as in the vm details. The sparkline widget in the vm overview only draws the rx and read rates.This is fixed up by a followup patch, since this way we're independent of the sparkline patches.

diff -r 30dc0d5939d4 src/virtManager/domain.py --- a/src/virtManager/domain.py Sat Oct 04 20:41:20 2008 +0200 +++ b/src/virtManager/domain.py Sat Oct 04 21:52:04 2008 +0200 @@ -149,6 +155,34 @@ self.lastStatus = status self.emit("status-changed", status)

+ def _network_traffic(self): + rx = 0 + tx = 0 + for netdev in self.get_network_devices(): + io = self.vm.interfaceStats(netdev[2]) + if io: + rx += io[0] + tx += io[4]

The standard behaviour libvirt python binding is to raise an exception if something fails, so checking for io == None isn't sufficient here. You should also wrap the call

try: io = self.vm.interfaceStats(netdev[2]) except: pass if io: rx += io[0] tx += io[4]

+ return rx, tx + + def _disk_io(self): + rd = 0 + wr = 0 + for disk in self.get_disk_devices(): + io = self.vm.blockStats(disk[3]) + if io: + rd += io[1] + wr += io[3] + return rd, wr

Likewise here.

Daniel