system with non blocking behavior • StatsD was proposed by etsy, There is no standard (yet). Implemented in Node.js • System sends metrics over UDP to StatsD server • StatsD server aggregates and flushes data to a persistent backend
type sent as text over UDP. • Client libraries available for many languages, easy to implement. • Compatible servers implemented in other languages (Python, Ruby, Perl, C, …) • A very common backend is Graphite
install statsd # - we sleep for a random time (max 5 secs) to simulate a # real action # - statsd timers are in microseconds import time import random import statsd client = statsd.StatsClient('localhost', 8125) start_t = time.time() client.incr('action') time.sleep(random.random() * 5) client.timing('action', (time.time() - start_t) * 1000 * 1000)
over time • Contains 3 components – Carbon: Network service to receive data – Whisper: Time series database file – Graphite: Web interface – Simple protocol: Text overt TCP with a name, value and a timestamp separated by space.