Statistics

Differences between revisions 1 and 2
Revision 1 as of 2013-06-07 11:46:22
Size: 963
Editor: ev
Comment:
Revision 2 as of 2013-06-07 11:47:31
Size: 1126
Editor: ev
Comment:
Deletions are marked like this. Additions are marked like this.
Line 29: Line 29:

Create a tunnel to your graphite instance:
{{{
ssh -N -L 8081:ip.of.graphite:80 ip.of.graphite
}}}

And point your browser at {{{http://localhost:8081}}}.

You can test talking to txstatsd to your own graphite instance in the cloud from your local machine.

First, create a txstatsd instance and a graphite instance:

juju bootstrap
juju deploy cs:~james-w/precise/txstatsd-2
juju deploy cs:~james-w/precise/graphite-0
juju add-relation graphite txstatsd

Now, tunnel UDP traffic to 8125 on your local machine to the txstatsd machine in the cloud:

local% ssh -N -L 6667:ip.of.txstatsd.instance:6667 ip.of.txstatsd.instance
local% socat udp4-listen:8125,reuseaddr,fork tcp:localhost:6667
txstatsd% socat tcp4-listen:6667,reuseaddr,fork UDP:localhost:8125

Finally, try it:

from txstatsd.client import UdpStatsDClient
from txstatsd.metrics.metrics import Metrics
conn = UdpStatsDClient(host='127.0.0.1', port=8125)
conn.connect()
METRICS = Metrics(connection=conn, namespace='whoopsie-daisy.daisy')
METRICS.meter('foobar', 1)
time.sleep(360)
METRICS.meter('foobar', 10)

Create a tunnel to your graphite instance:

ssh -N -L 8081:ip.of.graphite:80 ip.of.graphite

And point your browser at http://localhost:8081.

ErrorTracker/Statistics (last edited 2013-06-07 11:47:31 by ev)