- sivy/node-statsd is feature complete and seems to be the most popular
- dscape/lynx has streams + (some wierd random/sampling stuff)
- msiebuhr/node-statsd-client has express helpers & multi child options
- fasterize/node-statsd-profiler has transformation function
- godmodelabs/statistik has a CLI interface
-
reuse UDP connection: yes
-
prefix: yes
-
suffix: yes
-
dnscache: yes
-
mock: yes
-
samplerate: yes
-
errors: yes (eventemitter & bubbleup)
-
timing: yes
-
count: yes
-
increment: yes
-
decrement: yes
-
gauge: yes
-
set: yes
-
batch: yes
-
callback: yes
-
reuse UDP connection: yes (+ provide your own)
-
prefix: yes (called scope)
-
error: provide an error function
-
network : USE of ephemeral sockets!
-
samplerate: yes (use special random)
-
batching yes:
-
increment: yes
-
decrement: yes
-
timing: yes
-
gauge: yes
-
set: yes
special:
- uses as stream in/out: yes (uses parser)
-
reuse UDP connections: yes (ephemeral socket)
-
prefix: yes
-
count: yes
-
gauges: yes
-
increment: yes
-
decrement: yes
-
sets: yes
-
timings: yes (delays)
special
- socketTimeout: yes
- children (multi prefix)
- express helper: yes (or per URL)
-
reuse UDP: no
-
callback: yes (but default prints to console)
-
samplerate: yes
-
prefix: no
-
suffix: yes
-
batch: yes
-
count: yes
-
gauges: yes
-
increment: yes
-
decrement: yes
-
sets: yes (called modify)
-
timings: (delays)
(fork from node-statsd)
-
samplerate: yes
-
timing: yes
-
count: yes
-
increment: yes
-
decrement: yes
-
gauge: yes
-
set: ??
-
timingstart: yes
-
timignend: yes
special:
- introduces: key aliases
- transformKey function: YES
Note: you can safely ignore this lib
- reuse UDP connection: no
- timing: yes
- count: yes
- increment: yes
- decrement: yes
- gauge: yes
- errors: total ignore
- prefix: no
- samplerate: no
- callback: no
Note: use node-statsd instead unless cli is something special for you. The feature set is smaller than node-statsd and no special features, so we'll ignore this
- udp connection reuse: no
- timing: yes
- counter: yes
- increment: yes
- decrement: yes
- gauge: yes
- rawSend: yes
- samplerate: yes
- batch: no
-
https://github.com/fetep/connect-logger-statsd/blob/master/lib/connect-logger-statsd.js Puts your responsetimes & status in statsd
-
Although the fork of @sansmischevia seems to be more advanced https://github.com/fetep/connect-logger-statsd/network Has ignore list, sends full path if needed,
-
https://github.com/dokipen/connect-statsd/blob/master/index.js This focuses on writeHead, it will calculate the timeelapsed before sending back to the client
Note: I've not included any specific backends here, we're focusing on generic statsd usage
-
https://github.com/dscape/winston-statsd (logger -> statsd)
-
https://github.com/dscape/statsd-parser (streaming parser)
-
https://github.com/benjaminwootton/StatsdDashboard (dashboard)
Sets are acting like simple counters, with the additional specificity that it ignores duplicate values.
Technically, all values are stored in a set, and the number of elements in the set is sent to graphite during flushes. Sets are also emptied during flushes (in the same way that counters are reset to 0).
We have been using it in production for a while now, and it is working as expected. The use case that was used during the development of that feature was the following (it has been since extended to other cases as well):
We want to graph the number of active logged in users on the website.
Maintaining that state across application servers to manually update gauges is non-trivial.
We send a message to statsd containing the id of the user making a request.
statsd store all unique values between flushes, and sends the number of elements in the set to graphite.