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