25#ifndef DETERMINISTICESPASYNCWEBSERVER_STATSD_H
26#define DETERMINISTICESPASYNCWEBSERVER_STATSD_H
61void statsd_begin(
const char *host, uint16_t port,
const char *global_tags);
void statsd_gauge_delta(const char *name, int64_t delta)
Adjust a gauge by a signed delta (sent as a +/- gauge update).
void statsd_begin(const char *host, uint16_t port, const char *global_tags)
Point the client at a collector and set optional global tags (added to every metric).
void statsd_count(const char *name, int64_t delta)
Increment a counter by delta (may be negative).
void statsd_timing(const char *name, uint32_t ms)
Record a timing/duration of ms milliseconds.
StatsdType
StatsD metric type codes (the token after the |).
@ STATSD_TIMING
emitted as "ms"
void statsd_set(const char *name, const char *member)
Add a unique member to a set (counts distinct values server-side).
size_t statsd_format(char *out, size_t cap, const char *name, const char *value, StatsdType type, float rate, const char *tags)
Format one StatsD line: name:value|type[|@rate][|#tags]. Pure - no I/O.
void statsd_gauge(const char *name, int64_t value)
Set a gauge to an absolute value.
void statsd_count_sampled(const char *name, int64_t delta, float rate)
Increment a counter, annotated with sample rate (0,1] so the server scales up.