README.md

metricsd

I am a node.js client library for
metricsd, a metrics aggregator for
Graphite that supports counters, histograms and
meters. Metricsd 0.4.2+ is recommended.

Install with npm install metricsd or download if you prefer.

metricsd?

Yeah. It's like
statsd, but with more types and less heavy
lifting, and thus an expanded protocol. statsd clients are compatible with
metricsd, but not vice versa. Sorry. If you wanted to, you could probably
implement a compatibility mode.

Usage

The library currently exports a factory function that creates an instance of
a Metrics object with the given options:

Timers start automatically, but can be restarted by calling timer.start().
You can wrap callbacks yourself with timer.wrap(callback).

To delete a timer, use metrics.deleteHistogram(name). To update a statistical
measurement directly, use metrics.updateHistogram(name, value).

Meters / Marks

To mark the occurrence of a named event, use metrics.mark(name). This is
useful for measuring event rates (e.g. requests per second).

To tell metricsd to stop tracking a meter, use metrics.deleteMeter(name).

Raw Metrics

To send a raw metric with no formatting or prefixes applied, use
metrics.write(metric). This is used internally by all other metrics. See
metricsd for more info on formatting.

Console Output

Specify log: true to emit metrics to STDOUT rather than the default UDP
socket.

If you provide a logger to the metricsd() factory (console.log or
compatible), it will be used to emit metric strings in the form metric:
<metric>. This can be convenient if your logs streams are being consumed by
something that can more efficiently funnel data into metricsd or similar.