Change in vdsm[master]: status: adding elapsed time in millis

nsoffer at redhat.com nsoffer at redhat.com
Mon May 25 12:34:36 UTC 2015


Nir Soffer has posted comments on this change.

Change subject: status: adding elapsed time in millis
......................................................................


Patch Set 6: Code-Review-1

(1 comment)

https://gerrit.ovirt.org/#/c/40904/6/vdsm/virt/vm.py
File vdsm/virt/vm.py:

Line 411:     """
Line 412:     def _get_elapsed_time_in_millis(self):
Line 413:         return str(
Line 414:             int(round(utils.monotonic_time() * 1000)) -
Line 415:             int(round(self._startTime * 1000))
self._startTime is initialized using time.time():

    self._startTime = time.time() - \
        float(self.conf.pop('elapsedTimeOffset', 0))

This is the number of seconds since 1970-01-01. monotonic_time is the time since unspecified starting point. You cannot subtract these values.

I think you should leave elapsed time as is, as it is good enough for measuring vm uptime, and clocks on different hosts should be reasonably synchronized. Couple seconds difference in vm uptime does not matter to anyone.

For messages, we want to time the message was sent, so we can order them on the engine. For this, using a monotonic timestamp is just fine.

So I suggest you add a new field named statusTime using the value of int(utils.monotonic_time() * 1000)
Line 416:         )
Line 417: 
Line 418:     lastStatus = property(_get_lastStatus, _set_lastStatus)
Line 419: 


-- 
To view, visit https://gerrit.ovirt.org/40904
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I38727e0eac7cb29c1dc7c9696568540b6545461c
Gerrit-PatchSet: 6
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Piotr Kliczewski <piotr.kliczewski at gmail.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek at redhat.com>
Gerrit-Reviewer: Michal Skrivanek <mskrivan at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski at gmail.com>
Gerrit-Reviewer: Vinzenz Feenstra <vfeenstr at redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list