Change in vdsm[master]: jsonrpc: log number of request during period of time

nsoffer at redhat.com nsoffer at redhat.com
Fri Jun 19 06:55:56 UTC 2015


Nir Soffer has posted comments on this change.

Change subject: jsonrpc: log number of request during period of time
......................................................................


Patch Set 1:

(2 comments)

https://gerrit.ovirt.org/#/c/42551/1/lib/yajsonrpc/__init__.py
File lib/yajsonrpc/__init__.py:

Line 476:     a batch is added separately. After time defined by timeout we log
Line 477:     number of requests.
Line 478:     """
Line 479:     def _attempt_log_stats(self):
Line 480:         self._counter += 1
Is this called by multiple threads?
Line 481:         now = monotonic_time()
Line 482:         if now > self._next_report:
Line 483:             self.log.info('%s requests processed during %s seconds',
Line 484:                           self._counter, self._timeout)


Line 481:         now = monotonic_time()
Line 482:         if now > self._next_report:
Line 483:             self.log.info('%s requests processed during %s seconds',
Line 484:                           self._counter, self._timeout)
Line 485:             self._next_report = now + self._timeout
Better use:

    self._next_report += self._timeout

Otherwise  the next report depends on the time of the first request in this hour.
Line 486:             self._counter = 0
Line 487: 
Line 488:     def _serveRequest(self, ctx, req):
Line 489:         self._attempt_log_stats()


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ica05cc22d5ee93d9c0016207386879c52a4acb34
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Piotr Kliczewski <piotr.kliczewski at gmail.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski at gmail.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: Yeela Kaplan <ykaplan at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list