Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A node.js library for interacting with statsd over UDP

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 README.md
Octocat-spinner-32 index.js
Octocat-spinner-32 package.json
README.md

statsd-singly

A node.js library for communicating with statsd over UDP. Provides mocha unit tests.

Examples

var statsd = require('statsd-singly').StatsD('localhost', 8125);

// Gauges
statsd.gauge({ users: 35 }).send();

// Multiple gauges
statsd.gauge({ users: 35, guests: 48 }).send();

// Any measurement can also specify a sample rate
statsd.gauge({ users: 35 }).sample(0.5).send();

// Timings (in milliseconds)
statsd.timing({ page-load: 74 }).send();

// Incrementing multiple counters
statsd.increment(['logins', 'errors']).send();

// Decrementing a counter
statsd.decrement('logins').send();

// Modifying a counter by more than +1 or -1
statsd.modify({ errors: 5 }).send();

// Modifying multiple counters
statsd.modify({ errors: 5, syntaxErrors: 2 }).send();
Something went wrong with that request. Please try again.