statsd_client

A simple, stateless StatsD client library.

Procs

proc newStatdClient(host = "localhost"; port = 8125; prefix = ""): StatsdClient {...}{.
    raises: [ValueError, OSError], tags: [].}
Initialize new client. Parameters: host, port, prefix   Source Edit
proc incr(client: StatsdClient; name: string; count = 1) {...}{.
    raises: [OSError, ValueError], tags: [WriteIOEffect].}
Increment a stat by "count"   Source Edit
proc decr(client: StatsdClient; name: string; count = 1) {...}{.
    raises: [OSError, ValueError], tags: [WriteIOEffect].}
Decrement a stat by "count"   Source Edit
proc gauge(client: StatsdClient; name: string; value: int | float; delta = false)
Set a gauge to a specified value If "delta" is true, the gauge is incremented or decremented by "value"   Source Edit
proc set(client: StatsdClient; name, value: string) {...}{.raises: [OSError, ValueError],
    tags: [WriteIOEffect].}
Count occurrences of unique values   Source Edit
proc meter(client: StatsdClient; name, value: string) {...}{.raises: [OSError, ValueError],
    tags: [WriteIOEffect].}
Count occurrences of unique values   Source Edit
proc timing(client: StatsdClient; name: string; duration: int | float)
Send a timing in milliseconds   Source Edit
proc histogram(client: StatsdClient; name: string; value: int | float)
Add a datapoint to a histogram   Source Edit

Templates

template timed(statsd_client: StatsdClient; name: string; body: typed): typed
Encapsulate a code block and time its execution in milliseconds   Source Edit