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.
Download the swc and add it to your project.
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);
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 MMXIV Simon Gregory. Released under the MIT license, see accompanying LICENSE file for further details.