Skip to content

Instantly share code, notes, and snippets.

@danilochilene
Created April 17, 2015 15:29
Show Gist options
  • Save danilochilene/5049e19622c86c765ce8 to your computer and use it in GitHub Desktop.
Save danilochilene/5049e19622c86c765ce8 to your computer and use it in GitHub Desktop.
Python script to load statsd to InfluxDB
import random
import statsd
n = 1
limit = 100000
while n <= limit:
c = statsd.StatsClient('localhost', 8125)
c.incr('foo') # Increment the 'foo' counter.
c.gauge('foo', random.randint(1, 100000000))
n = n +1
@danilochilene
Copy link
Author

time python bulk_statsd.py
python bulk_statsd.py 4,64s user 4,02s system 94% cpu 9,160 total

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment