Change in vdsm[master]: core: Add boot time to the getVdsStats API

danken at redhat.com danken at redhat.com
Tue Mar 25 12:28:04 UTC 2014


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 <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