nimblebox logo
Docs
v2.1.0

nbox.sub_utils.latency

Utilities for measuring elapsed time. From TensorBoard (Apache-v2).

Functions

iconfunctionlog_latency
[source]

Log latency in a function or region. Three usages are supported. As a decorator:

>>> @log_latency
... def function_1():
...   pass
...

As a decorator with a custom label for the region:

>>> @log_latency("custom_label")
... def function_2():
...   pass
...

As a context manager:

>>> def function_3():
...   with log_latency("region_within_function"):
...     pass
...
  • region_name_or_function_to_decorate: Either: a str, in which case the result of this function may be used as either a decorator or a context manager; or a callable, in which case the result of this function is a decorated version of that callable.
  • log_level: Optional integer logging level constant. Defaults to logging.INFO.

Returns:

  • None: A decorated version of the input callable, or a dual decorator/context manager with the input region name.
iconfunction_log_latency
[source]
iconfunction_log
[source]

Classes

iconclass_ThreadLocalStore
[source]
iconfunction__init__
[source]
nbox SDKnbox provides built in access to all the APIs and packages them in the most user friendly manner.Star 0