Created
September 14, 2014 10:12
-
-
Save ezotrank/d2d48b0c7dc6802a387c to your computer and use it in GitHub Desktop.
simple logsend bench
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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" | |
} | |
} | |
] | |
} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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