Change in vdsm[master]: core: Add boot time to the getVdsStats API
ybronhei at redhat.com
ybronhei at redhat.com
Tue Mar 25 11:23:18 UTC 2014
Yaniv Bronhaim has posted comments on this change.
Change subject: core: Add boot time to the getVdsStats API
......................................................................
Patch Set 4:
(2 comments)
http://gerrit.ovirt.org/#/c/25877/4/lib/vdsm/utils.py
File lib/vdsm/utils.py:
Line 1266: self._finally.insert(0, (func, args, kwargs))
Line 1267:
Line 1268:
Line 1269: @memoized
Line 1270: def getBootTime():
you should keep the memoized, but there is no reason for putting it under utils.py. currently this function is required only by sampling.py . keep it there
Line 1271: with file('/proc/stat') as f:
Line 1272: btime_line = [l for l in f.read().splitlines()
Line 1273: if l.startswith('btime')][0]
Line 1273: startswith
a bit of waist (not much, but still)
take it as all values we retrieve from /proc/stat - map(int, file('/proc/stat').readline().split()[x:y]) (in sampling.py)
or maybe.. we should have getStat in utils that returns namedtuple, as we do in utils:pidStat function. can be useful , but the former is preferable in this patch scope
--
To view, visit http://gerrit.ovirt.org/25877
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I319e619cdaecac2f86d0154e3adbb3beda9c57d6
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dima Kuznetsov <dkuznets at redhat.com>
Gerrit-Reviewer: Adam Litke <alitke at redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Douglas Schilling Landgraf <dougsland at redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi at redhat.com>
Gerrit-Reviewer: Tal Nisan <tnisan at redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
More information about the vdsm-patches
mailing list