Skip to content

Instantly share code, notes, and snippets.

@panchicore
Last active August 29, 2015 14:08
Show Gist options
  • Save panchicore/3bcbcd21e81bc90be791 to your computer and use it in GitHub Desktop.
Save panchicore/3bcbcd21e81bc90be791 to your computer and use it in GitHub Desktop.
how to know what requests are super slow in your uswgi server
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