C port of Etsy's statsd
C CMake Other
Permalink
Failed to load latest commit information.
redhat
src Merge branch 'master' of github.com:jbuchbinder/statsd-c Dec 1, 2014
.gitignore More defines, better cmake config. Dec 28, 2011
.travis.yml Migrate to new Travis CI build system. Aug 24, 2015
CMakeLists.txt Use cmake version 2.8, put in dependencies, etc, for new json-c libra… Sep 11, 2013
LICENSE Initial commit. Oct 25, 2011
README.md Fix small formatting issue. Feb 8, 2013
TODO Wishful thinking? Jul 31, 2012
VERSION
statsd-c.spec.in Fix packaging to remove any node references. Oct 4, 2012

README.md

STATSD-C

Build
Status

SUMMARY

Reimplementation of Etsy's infamous "statsd" in C.

Your mileage may vary. It works for me, and it should be wire compatible with the original node.js-based statsd.

There are some libraries used/included:

Build with cmake . && make. A simple client to submit data called "statsd_client" is built as well.

FEATURES

  • Wire compatible with original statsd, or use the handy JSON format instead...
  • Small, fast, efficient, with no VM overhead.
  • Able to de/serialize state to/from disk.
  • Direct stat flush to ganglia's gmond.

USAGE

Usage: statsd [-hDdfFc] [-p port] [-m port] [-s file] [-G host] [-g port] [-S spoofhost] [-P prefix] [-l lockfile] [-T percentiles]
    -p port           set statsd udp listener port (default 8125)
    -m port           set statsd management port (default 8126)
    -s file           serialize state to and from file (default disabled)
    -G host           ganglia host (default disabled)
    -g port           ganglia port (default 8649)
    -S spoofhost      ganglia spoof host (default statsd:statsd)
    -P prefix         ganglia metric prefix (default is none)
    -l lockfile       lock file (only used when daemonizing)
    -h                this help display
    -d                enable debug
    -D                daemonize
    -f                enable friendly mode (breaks wire compatibility)
    -F seconds        set flush interval in seconds (default 10)
    -c                clear stats on startup
    -T                percentile thresholds, csv (defaults to 90)

JSON FORMAT

Input can be specified as either a JSON object or an array of JSON objects. An example of some different inputs would be:

  • Increase counter 'test_counter' by 300:
    {'counter':'test_counter','value':300}
  • Add two counters:
    [{'counter':'count1','value':1.0},{'counter':'count2','value':1.0}]
  • Add a counter with a set sample rate:
    {'counter':'sample','value':5,'sample_rate':10}
  • Set a timer:
    {'timer':'test_timer','value':12345}