Gal Hammer has posted comments on this change.
Change subject: Add qemu's memory usage to VM statistics. ......................................................................
Patch Set 2: (2 inline comments)
.................................................... Commit Message Line 6: Line 7: Add qemu's memory usage to VM statistics. Line 8: Line 9: Change-Id: Ibeb35759454c4a9b41e1303956267e93ca3545a0 Line 10: Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=799285 I'll remove it.
.................................................... File vdsm/libvirtvm.py Line 172: return netSamples Line 173: Line 174: def _sampleMem(self): Line 175: memUsage = {} Line 176: for line in open('/proc/%d/status' %(self.conf['pid'])): I don't know if using "with" is more "pythonic". I think I use "with" only if more than one method is executed.
As for the conf['pid']. The _sampleMem function is called from the vmstats thread, so I don't understand why it is a problem. Line 177: var, value = line.strip().split()[0:2] Line 178: if var in ('VmSize:', 'VmRSS:', 'VmData:'): Line 179: memUsage[var[:-1]] = long(value) Line 180: return memUsage
-- To view, visit http://gerrit.ovirt.org/9006 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Ibeb35759454c4a9b41e1303956267e93ca3545a0 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Gal Hammer ghammer@redhat.com Gerrit-Reviewer: Gal Hammer ghammer@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Michal Skrivanek michal.skrivanek@redhat.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: ShaoHe Feng shaohef@linux.vnet.ibm.com