Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/federicoceratto/nim-statsd-client

A simple StatsD client for Nim
https://github.com/federicoceratto/nim-statsd-client

metrics nim nim-lang nim-language nimlang statsd

Last synced: 26 days ago
JSON representation

A simple StatsD client for Nim

Awesome Lists containing this project

README

        

### 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()
----