Change in vdsm[master]: Add the host uptime in seconds to host stats

tnisan at redhat.com tnisan at redhat.com
Tue Mar 18 17:33:01 UTC 2014


Tal Nisan has posted comments on this change.

Change subject: Add the host uptime in seconds to host stats
......................................................................


Patch Set 1:

(1 comment)

http://gerrit.ovirt.org/#/c/25835/1/vdsm/API.py
File vdsm/API.py:

Line 1238:         stats['dateTime'] = '%02d-%02d-%02dT%02d:%02d:%02d GMT' % (
Line 1239:             tm_year, tm_mon, tm_day, tm_hour, tm_min, tm_sec)
Line 1240:         with open('/proc/uptime', 'r') as f:
Line 1241:             uptime = float(f.readline().split()[0])
Line 1242:             stats['uptime'] = str(uptime)
> use '%.2s', as simple str() adds pointless insignificant digits.
This will return only the first two left hand digits of the number while cutting the rest..
In any way, the /proc/uptime has only 2 digits right of the floating point which is what we want anyway
Line 1243:         if self._cif.mom:
Line 1244:             stats['momStatus'] = self._cif.mom.getStatus()
Line 1245:             stats.update(self._cif.mom.getKsmStats())
Line 1246:         else:


-- 
To view, visit http://gerrit.ovirt.org/25835
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I5ebb9c27d99e50dd397db6fc97e03c4215aed456
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Tal Nisan <tnisan at redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Dima Kuznetsov <dkuznets at redhat.com>
Gerrit-Reviewer: Douglas Schilling Landgraf <dougsland at redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Tal Nisan <tnisan 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