Skip to content

Instantly share code, notes, and snippets.

@bgulla
Created March 12, 2015 12:49
Show Gist options
  • Select an option

  • Save bgulla/908998a2c67485e4a39e to your computer and use it in GitHub Desktop.

Select an option

Save bgulla/908998a2c67485e4a39e to your computer and use it in GitHub Desktop.
#!/usr/bin/python
import time
import random
import statsd
counter_name = 'db1'
wait_s = 1
while 1:
c = statsd.StatsClient('localhost', 8125)
random_count = random.randrange(1, 100)
print 'Count=(%d)' % random_count
while random_count > 0:
c.incr(counter_name, 5)
random_count -= 1
time.sleep(wait_s)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment