Last active
August 29, 2015 14:08
-
-
Save panchicore/3bcbcd21e81bc90be791 to your computer and use it in GitHub Desktop.
how to know what requests are super slow in your uswgi server
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 sys | |
with open(sys.argv[1]) as f: | |
content = f.readlines() | |
for line in content: | |
parts = line.split("bytes in ") | |
if len(parts)>1: | |
msecs = parts[1].split(" msecs ")[0] | |
msecs = int(msecs) | |
if msecs >= int(sys.argv[2]) and msecs <= int(sys.argv[3]): | |
print line | |
# give me the request in the log where response is generated btw 30 and 60 secs | |
# python uswgi_msecs.py uwsgi.log 30000 60000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment