def __init__(self, registry=None, reporting_interval=30, clock=None): self.registry = registry or global_registry() self.reporting_interval = reporting_interval self.clock = clock or time self._stopped = Event() self._loop_thread = Thread(target=self._loop) self._loop_thread.setDaemon(True)
def gauge(key, gauge=None, default=float("nan"), **dims): """Adds gauge with dimensions to the global pyformance registry""" return global_registry().gauge(key, gauge=gauge, default=default, **dims)
def timer(key, **dims): """Adds timer with dimensions to the global pyformance registry""" return global_registry().timer(key, **dims)
def histogram(key, **dims): """Adds histogram with dimensions to the global pyformance registry""" return global_registry().histogram(key, **dims)
def __init__(self, registry=None, reporting_interval=30, clock=None): self.registry = registry or global_registry() self.reporting_interval = reporting_interval self.clock = clock or time self._stopped = Event() self.create_thread()
def gauge(key, gauge=None, default=float("nan"), **dims): """Adds gauge with dimensions to the global pyformance registry""" return global_registry().gauge(key, gauge=gauge, default=default, **dims)
def timer(key, **dims): """Adds timer with dimensions to the global pyformance registry""" return global_registry().timer(key, **dims)
def histogram(key, **dims): """Adds histogram with dimensions to the global pyformance registry""" return global_registry().histogram(key, **dims)