dplutils.observer.Observer

dplutils.observer.Observer#

class dplutils.observer.Observer[source]#

Observer base class for recording metrics

Since it is not known at runtime what concrete implementation will be used, any subclass should take the args in full and silently ignore any that do not apply. Be mindful of raises exceptions in any of these functions as many cases it is preferred to lose some observability for continued execution.

While implementations are required to implement observe, increment and param, there may be legitimit cases where the recording of

__init__()#

Methods

__init__()

increment(name[, value])

Increment a counter

observe(name, value, **kwargs)

Observe a metric value

param(name, value, **kwargs)

Record a run parameter

timer(name, **kwargs)

Return a timer context manager recoding to this observer