From e83d53f948df502b14119e4faf6dac88806c21ba Mon Sep 17 00:00:00 2001 From: Patrick Hensley Date: Wed, 29 Jun 2011 12:09:23 -0400 Subject: [PATCH] Release 0.3.1 * Created rst README.txt for PyPI --- README.txt | 110 ++++++++++++++++++++++++++++++++++++++++++++++- debian/changelog | 2 +- gstatsd/core.py | 2 +- 3 files changed, 111 insertions(+), 3 deletions(-) mode change 120000 => 100644 README.txt diff --git a/README.txt b/README.txt deleted file mode 120000 index 42061c0..0000000 --- a/README.txt +++ /dev/null @@ -1 +0,0 @@ -README.md \ No newline at end of file diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..64cde23 --- /dev/null +++ b/README.txt @@ -0,0 +1,109 @@ +gstatsd - A statsd service implementation in Python + gevent. + +If you are unfamiliar with statsd, you can read +`why statsd exists `_, +or look at the +`NodeJS statsd implementation `_. + +License: +`Apache 2.0 `_ + +Requirements +------------ + + +- `Python `_ - I'm testing on 2.6/2.7 at + the moment. +- `gevent `_ - A libevent wrapper. +- `distribute `_ - (or + setuptools) for builds. + +Using gstatsd +------------- + +Show gstatsd help: + +:: + + % gstatsd -h + +Options: + +:: + + Usage: gstatsd [options] + + A statsd service in Python + gevent. + + Options: + --version show program's version number and exit + -h, --help show this help message and exit + -b BIND_ADDR, --bind=BIND_ADDR + bind [host]:port (host defaults to '') + -d DEST_ADDR, --dest=DEST_ADDR + receiver [backend:]host:port (backend defaults to + 'graphite') + -v increase verbosity (currently used for debugging) + -f INTERVAL, --flush=INTERVAL + flush interval, in seconds (default 10) + -p PERCENT, --percent=PERCENT + percent threshold (default 90) + -l, --list list supported backends + -D, --daemonize daemonize the service + +Start gstatsd and send stats to port 9100 every 5 seconds: + +:: + + % gstatsd -d :9100 -f 5 + +Bind listener to host 'hostname' port 8126: + +:: + + % gstatsd -b hostname:8126 -d :9100 -f 5 + +To send the stats to multiple graphite servers, specify multiple +destinations: + +:: + + % gstatsd -b :8125 -d stats1:9100 stats2:9100 + +Using the client +---------------- + +The code example below demonstrates using the low-level client +interface: + +:: + + from gstatsd import client + + # location of the statsd server + hostport = ('', 8125) + + raw = client.StatsClient(hostport) + + # add 1 to the 'foo' bucket + raw.increment('foo') + + # timer 'bar' took 25ms to complete + raw.timer('bar', 25) + +You may prefer to use the stateful client: + +:: + + # wraps the raw client + cli = client.Stats(raw) + + timer = cli.get_timer('foo') + timer.start() + + ... do some work .. + + # when .stop() is called, the stat is sent to the server + timer.stop() + + diff --git a/debian/changelog b/debian/changelog index fba9623..89b969b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -gstatsd (0.3) lucid; urgency=low +gstatsd (0.3.1) lucid; urgency=low * Release. diff --git a/gstatsd/core.py b/gstatsd/core.py index 56d8ded..c78aaf0 100644 --- a/gstatsd/core.py +++ b/gstatsd/core.py @@ -1,3 +1,3 @@ -__version__ = '0.3' +__version__ = '0.3.1'