mirror of
https://github.com/FedericoCeratto/nim-statsd-client
synced 2026-01-03 00:44:49 +00:00
No description
| src | ||
| .gitignore | ||
| LICENSE | ||
| README.adoc | ||
| statsd_client.nimble | ||
### StatsD client for Nim
image:https://img.shields.io/badge/status-beta-orange.svg[badge]
image:https://img.shields.io/github/tag/FedericoCeratto/nim-statsd-client.svg[tags]
image:https://img.shields.io/badge/License-LGPL%20v3-blue.svg[License]
A simple, stateless StatsD client.
Documentation: https://federicoceratto.github.io/nim-statsd-client/0.1.1/statsd_client.html[module] https://federicoceratto.github.io/nim-statsd-client/0.1.1/theindex.html[index]
Install:
[source,bash]
----
nimble install statsd_client
----
Usage example:
[source,nim]
----
import statsd_client
let stats = newStatdClient(prefix="foo")
stats.incr("mycnt")
stats.incr("mycnt", 3)
stats.decr("mycnt", 3)
stats.timing("mytimer_float", 110.0)
stats.timing("mytimer_int", 110)
stats.gauge("mygauge", 1.0)
stats.gauge("mygauge", 2)
stats.gauge("mygauge", 1, delta=true)
stats.gauge("mygauge", -2, delta=true)
stats.set("set_one", "a")
stats.set("set_one", "b")
stats.timed("mytimer"):
slow_proc()
----