Skip to content

Instantly share code, notes, and snippets.

@Leechael
Created July 31, 2016 16:35
Show Gist options
  • Save Leechael/1c7f4205b237a8482e055b9fd685e750 to your computer and use it in GitHub Desktop.
Save Leechael/1c7f4205b237a8482e055b9fd685e750 to your computer and use it in GitHub Desktop.
Poorman's mitmproxy based request timing
from time import time
def start(context):
context.log("Format: [send data timing] [waitting timing] [receive data timing] Request URL")
def request(context, flow):
context.started_at = time()
def response(context, flow):
sending = flow.request.timestamp_end - flow.request.timestamp_start
receive = flow.response.timestamp_end - flow.response.timestamp_start
waitting = time() - context.started_at - receive
context.log("[%.4fs] [%.4fs] [%.4fs] %s%s" % (sending, waitting, receive, flow.request.host, flow.request.path))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment