Created
January 3, 2012 22:59
-
-
Save haf/1557425 to your computer and use it in GitHub Desktop.
C# snippet for Graphite
This file contains hidden or 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 an UDP client for sending metrics to "localhost:2003", prefixing all keys with "foo.bar" | |
using(var client = new GraphiteUdpClient("192.168.1.45", 2003, "jayway.letslog")) | |
{ | |
// Report a metric | |
client.Send("baz", 10); | |
// Report a metric specifying timestamp | |
client.Send("baz", 21, DateTime.UtcNow.AddSeconds(42)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment