instrument.statsd

“Bare-bones implementation of statsD’s protocol, client-side”

Module Contents

Classes

Statsd(self,cfg) statsD-based instrumentation, that passes as a logger
class Statsd(cfg)

statsD-based instrumentation, that passes as a logger

__init__(cfg)

host, port: statsD server

critical(msg, *args, **kwargs)
error(msg, *args, **kwargs)
warning(msg, *args, **kwargs)
exception(msg, *args, **kwargs)
info(msg, *args, **kwargs)
debug(msg, *args, **kwargs)
log(lvl, msg, *args, **kwargs)

Log a given statistic if metric, value and type are present

access(resp, req, environ, request_time)

Measure request duration request_time is a datetime.timedelta

gauge(name, value)
increment(name, value, sampling_rate=1.0)
decrement(name, value, sampling_rate=1.0)
histogram(name, value)
_sock_send(msg)