Created
June 4, 2014 00:48
-
-
Save tomas-edwardsson/5f40ae4b146041801056 to your computer and use it in GitHub Desktop.
Test performance in sorting pynag.Parsers.LogFiles.get_log_entries()
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
#!/usr/bin/python | |
from pynag.Parsers import LogFiles | |
import time | |
logs = LogFiles() | |
result = logs.get_log_entries( | |
start_time=time.time() - (86400 * 3) | |
).sort(key=lambda x: x['time']) |
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
#!/usr/bin/python | |
from pynag.Parsers import LogFiles | |
import time | |
logs = LogFiles() | |
result = logs.get_log_entries(start_time=time.time() - (86400 * 3)) |
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
[tommi@monitor01 ~]$ for i in 1 2 3; do time python logdemo-sorted.py; done | |
real 0m13.449s | |
user 0m12.798s | |
sys 0m0.636s | |
real 0m13.390s | |
user 0m12.735s | |
sys 0m0.610s | |
real 0m13.462s | |
user 0m12.874s | |
sys 0m0.574s | |
[tommi@monitor01 ~]$ for i in 1 2 3; do time python logdemo.py; done | |
real 0m13.653s | |
user 0m12.983s | |
sys 0m0.653s | |
real 0m13.840s | |
user 0m13.081s | |
sys 0m0.620s | |
real 0m13.575s | |
user 0m12.924s | |
sys 0m0.606s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment