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 <[email protected]> Gerrit-Reviewer: Adam Litke <[email protected]> Gerrit-Reviewer: Antoni Segura Puimedon <[email protected]> Gerrit-Reviewer: Dan Kenigsberg <[email protected]> Gerrit-Reviewer: Douglas Schilling Landgraf <[email protected]> Gerrit-Reviewer: Saggi Mizrahi <[email protected]> Gerrit-Reviewer: Tal Nisan <[email protected]> Gerrit-Reviewer: Yaniv Bronhaim <[email protected]> Gerrit-Reviewer: [email protected] Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
