Search code examples
graphitestatsd

Statsd: Which metric to use to measure data throughput


I'm fairly new to statsd, I want to measure the aggregated data volume/second that my process uses, but cannot find the correct statsd metric for it:

  • increment would be good, as it gives rate, but cannot increment with a value
  • gauge doesn't aggregate, just sets a value
  • timers also don't feel right

So which one should I choose, and how should I use it?


Solution

  • Use a counter, you can increment it with a value. For example to increment foo by 3

    echo "foo:3|c" | nc -u -w0 127.0.0.1 8125
    

    From the data types docs:

    You can increment a counter by more than one by passing a second parameter:

    statsd.incr('some.other.event', 10)