metrics

metrics Base

Monasca-Statsd based metrics

Based on metrics-and-stats blueprint

Usage examples:

from designate.metrics import metrics

@metrics.timed('dot.separated.name')
def your_function():
    pass

with metrics.time('dot.separated.name'):
    pass

# Increment and decrement a counter.
metrics.counter(name='foo.bar').increment()
metrics.counter(name='foo.bar') -= 10
class designate.metrics.Metrics[source]

Bases: object

__dict__ = dict_proxy({'__dict__': <attribute '__dict__' of 'Metrics' objects>, 'counter': <function counter at 0x7f612bf702a8>, 'timed': <property object at 0x7f612c06bfc8>, '__doc__': None, 'timer': <function timer at 0x7f612bf70410>, '__module__': 'designate.metrics', '__init__': <function __init__ at 0x7f612bf701b8>, 'init': <function init at 0x7f612bf70230>, 'gauge': <function gauge at 0x7f612bf70320>, '__weakref__': <attribute '__weakref__' of 'Metrics' objects>})
__init__()[source]

Initialize Monasca-Statsd client with its default configuration. Do not start sending metrics yet.

__module__ = 'designate.metrics'
__weakref__

list of weak references to the object (if defined)

counter(*a, **kw)[source]
gauge(*a, **kw)[source]
init()[source]

Setup client connection or disable metrics based on configuration. This is called once the cfg.CONF is ready.

timed
timer()[source]