Tal Nisan has uploaded a new change for review. Change subject: Add the host uptime in seconds to host stats ......................................................................
Add the host uptime in seconds to host stats Change-Id: I5ebb9c27d99e50dd397db6fc97e03c4215aed456 Signed-off-by: Tal Nisan <[email protected]> Bug-Url: https://bugzilla.redhat.com/1070348 --- M vdsm/API.py 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/35/25835/1 diff --git a/vdsm/API.py b/vdsm/API.py index ae959ef..a58572d 100644 --- a/vdsm/API.py +++ b/vdsm/API.py @@ -1237,6 +1237,9 @@ dummy, dummy, dummy) = time.gmtime(time.time()) stats['dateTime'] = '%02d-%02d-%02dT%02d:%02d:%02d GMT' % ( tm_year, tm_mon, tm_day, tm_hour, tm_min, tm_sec) + with open('/proc/uptime', 'r') as f: + uptime = float(f.readline().split()[0]) + stats['uptime'] = str(uptime) if self._cif.mom: stats['momStatus'] = self._cif.mom.getStatus() stats.update(self._cif.mom.getKsmStats()) -- To view, visit http://gerrit.ovirt.org/25835 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5ebb9c27d99e50dd397db6fc97e03c4215aed456 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Tal Nisan <[email protected]> _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
