OpenStack library utils
346c27b735
Create a helpful decorator that can be attached to functions or methods to show how long they take to run; internally it uses a stop watch and provided logger to log with (and an optional logging level to use). An example: >>> from oslo_utils import timeutils >>> import logging >>> import time >>> logging.basicConfig(level=logging.DEBUG) >>> logger = logging.getLogger() >>> >>> @timeutils.time_it(logger) ... def a(): ... time.sleep(0.2) ... >>> a() DEBUG:root:It took 0.20 seconds to run function '__main__.a' Change-Id: Ia41d5b6910f7ebe2dd93aaf6ca1defe158f8310c |
||
---|---|---|
doc/source | ||
oslo_utils | ||
oslo.utils/locale | ||
tools | ||
.coveragerc | ||
.gitignore | ||
.gitreview | ||
.mailmap | ||
.testr.conf | ||
babel.cfg | ||
CONTRIBUTING.rst | ||
HACKING.rst | ||
LICENSE | ||
MANIFEST.in | ||
README.rst | ||
requirements.txt | ||
setup.cfg | ||
setup.py | ||
test-requirements.txt | ||
tox.ini |
oslo.utils
The oslo.utils library provides support for common utility type functions, such as encoding, exception handling, string manipulation, and time handling.
- Free software: Apache license
- Documentation: http://docs.openstack.org/developer/oslo.utils
- Source: http://git.openstack.org/cgit/openstack/oslo.utils
- Bugs: http://bugs.launchpad.net/oslo.utils