Skip to content

Instantly share code, notes, and snippets.

@haf
Created January 3, 2012 22:59
Show Gist options
  • Save haf/1557425 to your computer and use it in GitHub Desktop.
Save haf/1557425 to your computer and use it in GitHub Desktop.
C# snippet for Graphite
// 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