Dan Kenigsberg has submitted this change and it was merged.
Change subject: utils: Add stopwatch for timing operations
......................................................................
utils: Add stopwatch for timing operations
stopwatch is a context manager that make it easy to time block of code
that may take significant amount of time.
Example:
with stopwatch("Resized multipath map %r" % name):
_resize_map(name)
Will log a debug message:
Resized multipath map 'dm-42': 0.12 seconds
If debug log level is not enabled, this contents manager does nothing.
The log can be disabled by disabling the vds.stopwatch logger.
Change-Id: Ie0a60538936dbb4596243abe9d731779fd9efb47
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
Reviewed-on:
https://gerrit.ovirt.org/29685
Continuous-Integration: Jenkins CI
Reviewed-by: Francesco Romani <fromani(a)redhat.com>
Reviewed-by: Federico Simoncelli <fsimonce(a)redhat.com>
---
M lib/vdsm/utils.py
M tests/utilsTests.py
2 files changed, 46 insertions(+), 0 deletions(-)
Approvals:
Nir Soffer: Verified
Federico Simoncelli: Looks good to me, approved
Jenkins CI: Passed CI tests
Francesco Romani: Looks good to me, but someone else must approve
--
To view, visit
https://gerrit.ovirt.org/29685
To unsubscribe, visit
https://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie0a60538936dbb4596243abe9d731779fd9efb47
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Polednik <mpolednik(a)redhat.com>
Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek(a)redhat.com>
Gerrit-Reviewer: Michal Skrivanek <mskrivan(a)redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org