Dan Kenigsberg has posted comments on this change. Change subject: core: Add boot time to the getVdsStats API ......................................................................
Patch Set 4: Code-Review-1 (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 u +1, and please add a unittest for this function. 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 1269: @memoized Line 1270: def getBootTime(): 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] > a bit of waist (not much, but still) I actually think that the "grep btime" method is nicer and safer. -- 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
