Created
September 24, 2011 07:29
-
-
Save ragnard/1239077 to your computer and use it in GitHub Desktop.
StatsD Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create a client for sending metrics to "localhost:8125", prefixing all keys with "foo.bar" | |
using(var client = new StatsClient("localhost", 8125, "foo.bar")) | |
{ | |
// Increment a counter | |
client.Incremenet("counter1"); // sends 'foo.bar.counter1:1|c' | |
// Increment a counter by 42 | |
client.Incremenet("counter2", 42); // sends 'foo.bar.counter2:1|c' | |
// Decrement a counter by 5, sampled every 1/10th time | |
client.Decrement("counter3", 5, 0.1); // sends 'foo.bar.counter3:-1|[email protected] | |
// Report that the blahonga operation took 42 ms | |
client.Timing("blahonga", 42); // sends 'foo.bar.blahonga:42|ms' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment