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
designate.metrics.
Metrics
[source]¶Bases: object
__dict__
= dict_proxy({‘__init__’: <function __init__>, ‘__weakref__’: <attribute ‘__weakref__’ of ‘Metrics’ objects>, ‘gauge’: <function gauge>, ‘counter’: <function counter>, ‘__module__’: ‘designate.metrics’, ‘__dict__’: <attribute ‘__dict__’ of ‘Metrics’ objects>, ‘timer’: <function timer>, ‘__doc__’: None, ‘init’: <function init>, ‘timed’: <property object>})¶__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)
init
()[source]¶Setup client connection or disable metrics based on configuration. This is called once the cfg.CONF is ready.
timed
¶Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.