StatsD

A simple client for the StatsD protocol.

Constructors

this
this(socket_t socket, string prefix, Random rng)

NOTE: Assumes socket is in connected state, and that it remain so until this object is destroyed. If the socket is or becomes disconnected, metrics will be dropped.

this
this()
Undocumented in source.

Members

Functions

count
void count(string key, int delta, float frequency)

Emits a simple counter metric. At each flush, a StatsD daemon will send the current count to an APM, and reset the count to 0.

decr
void decr(string key, float frequency)

Equivalent to count(key, -1, frequency).

gauge
void gauge(string key, uint value, float frequency)

Emits a gauge which maintains its value until it is next set.

incr
void incr(string key, float frequency)

Equivalent to count(key, 1, frequency).

seed
void seed(uint seed)

(Re-)seeds the random number generator used to sample metrics.

set
void set(string key, uint value)

Emits a set metric. A StatsD daemon will count unique occurrences of each value between flushes.

timing
void timing(string key, uint ms, float frequency)

Emits a timing metric in milliseconds. A StatsD daemon will produce a histogram of these timings with a rollup duration equal to its flush interval.

Meta