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>, '__module__': 'designate.metrics', 'gauge': <function gauge at 0x7f81f3ef1d70>, '__init__': <function __init__ at 0x7f81f3efc7d0>, 'timed': <property object at 0x7f81f3f04890>, 'counter': <function counter at 0x7f81f3ef1cf8>, '__weakref__': <attribute '__weakref__' of 'Metrics' objects>, 'init': <function init at 0x7f81f3ef1c80>, 'timer': <function timer at 0x7f81f3ef1e60>, '__doc__': None})
__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]