3. History
StatsD is a front-end proxy for the Graphite/
Carbon metrics server.!
Originally written by Etsy’s Erik Kastner!
The first idea from Flickr by Cal Henderson!
Implemented in Node
4. StatsD in many languages
Flickr’s StatsD: Perl. The real original statsd from 2008.!
Etsy’s statsd: Node.js. The new statsd.!
petef-statsd: Ruby. Supports AMQP.!
quasor/statsd: Ruby. can send data to graphite or mongoDB!
py-statsd: Python (including python client code).!
statsd.scala: Scala. Sends data to Ganglia instead of Graphite. Different messaging
protocol, uses JSON.!
statsd-c: C. compatible with original etsy statsd!
bucky: Python. A small server for collecting and translating metrics for Graphite.
It can current collect metric data from CollectD daemons and from StatsD clients.
Reference: http://www.joemiller.me/2011/09/21/list-of-statsd-server-implementations/
5. Architecture
Your App send data to StatsD by UDP port
8125!
StatsD send data to Carbon by TCP port 2003
6. Metric Types
Count [key]:[value]|c!
sample.counter:1|c!
At each flush the current count is sent and reset to 0!
Sampling!
sample.counter:1|c@0.1!
sent sampled every 1/10th of the time!
Scenarios!
View count
Reference: https://github.com/etsy/statsd/blob/master/docs/metric_types.md
7. Metric Types
Gauge [key]:[value]|g!
sample.gauge:75|g!
If the gauge is not updated at the next flush,
it will send the previous value.!
Scenarios!
Resource number
8. Metric Types
Set [key]:[value]|s!
sapmle.set:4219|s!
Counting unique occurrences of events between
flushes, using a Set to store all occurring events.!
Scenarios!
Unique user count
9. Metric Types
Timing [key]:[value]|ms!
sample.timer:10000|ms!
Scenarios!
To calculate the difference time!
Response time calculation
19. Further Items
StatsD Cluster Proxy!
Refactor 3DS FrontServer!
Collect response time during component
communication!
Collect data from GPS (Windows)