Skip to content

Instantly share code, notes, and snippets.

@ezotrank
Created September 14, 2014 10:12
Show Gist options
  • Save ezotrank/d2d48b0c7dc6802a387c to your computer and use it in GitHub Desktop.
Save ezotrank/d2d48b0c7dc6802a387c to your computer and use it in GitHub Desktop.
simple logsend bench
import os
import time
line_per_second = 25000
cycles = 100
log_file_name = 'test.log'
msg = "test string one\n"
try:
os.remove(log_file_name)
except:
pass
with open(log_file_name, "a") as myfile:
for x in range(0, cycles):
myfile.write(msg*line_per_second)
time.sleep(1)
print("%s/%s" % (x, cycles))
{
"influxdb": {
"host": "host:4444",
"user": "root",
"password": "root",
"database": "logers",
"udp": true,
"send_buffer": 8
},
"groups": [
{
"mask": "test.log",
"rules": [
{
"regexp": "test string (?P<word_STRING>\\w+)",
"influxdb": {
"name": "test"
}
}
]
}
]
}
wc -l test.log
2500000 test.log
http://cl.ly/image/3j3c220P400H
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment