Skip to content

Instantly share code, notes, and snippets.

@nychng
Created June 28, 2013 09:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nychng/5883607 to your computer and use it in GitHub Desktop.
Save nychng/5883607 to your computer and use it in GitHub Desktop.
test script for graphite
#!/usr/bin/env python
import socket
import time
CARBON_SERVER = '0.0.0.0'
CARBON_PORT = 2003
message = 'foo.bar.baz 42 %d\n' % int(time.time())
print 'sending message:\n%s' % message
sock = socket.socket()
sock.connect((CARBON_SERVER, CARBON_PORT))
sock.sendall(message)
sock.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment