/flash-statsd

A Flash client for StatsD

Primary LanguageActionScriptMIT LicenseMIT

Flash StatsD

An ActionScript 3 client for StatsD, Etsy's daemon for easy stats aggregation.

UDP support is only available to the AIR runtime. It will not work where the runtime sandbox is restricted, ie browser plugin.

Setup

Download the swc and add it to your project.

Usage

Increment the counter 'specialStuff' on a statsd server listening at 127.0.0.1:8125

client = new StatsD();
client.increment('specialStuff');

Send a gauge 'royston.vasey.localPeople' of 13 to a statsd server listening at 1.2.3.4:5678

client = new StatsD('1.2.3.4', 5678, 'royston.vasey');
client.gauge('localPeople', 13);

Available metrics calls:

counter(name:String, amount:int);

increment(name:String);

decrement(name:String);

time(name:String, time:uint/*in milliseconds*/);

gauge(name:String, amount:uint);

histogram(name:String, amount:uint);

meter(name:String, amount:uint);

More Reading

The Statsd Spec.
Other Statsd Clients.
Statsd Python Docs are informative.
UDP packets may well get discarded if they exceed the MTU of the network.

Copyright

Copyright MMXIV Simon Gregory. Released under the MIT license, see accompanying LICENSE file for further details.