mirror of
https://github.com/zhigang1992/mitmproxy.git
synced 2026-05-04 20:10:50 +08:00
Tweak timing display
- Remove elapsed time. Space is at a premium here, and this is somewhat redundant with the rate figure. We should display complete timing information somewhere in the detailed flow view. - Tone down the colour. Reserve highlights for stuff that should really pop out to the user. - Make rate calculation more acurate. Include header sizes. Use response start and end time, rather than request end and response end. This means that we show actual transfer rates, not including DNS requests and so forth.
This commit is contained in:
@@ -144,9 +144,7 @@ def raw_format_flow(f, focus, extended, padding):
|
||||
if f["resp_ctype"]:
|
||||
resp.append(fcol(f["resp_ctype"], rc))
|
||||
resp.append(fcol(f["resp_clen"], rc))
|
||||
|
||||
resp.append(fcol(f["resp_et"], "time"))
|
||||
resp.append(fcol(f["resp_rate"], "highlight"))
|
||||
resp.append(fcol(f["resp_rate"], rc))
|
||||
|
||||
elif f["err_msg"]:
|
||||
resp.append(fcol(SYMBOL_RETURN, "error"))
|
||||
@@ -190,15 +188,15 @@ def format_flow(f, focus, extended=False, hostheader=False, padding=2):
|
||||
else:
|
||||
contentdesc = "[no content]"
|
||||
|
||||
delta = f.response.timestamp_end - f.request.timestamp_start
|
||||
rate = utils.pretty_size(len(f.response.content) / delta)
|
||||
delta = f.response.timestamp_end - f.response.timestamp_start
|
||||
size = len(f.response.content) + f.response.get_header_size()
|
||||
rate = utils.pretty_size(size / delta)
|
||||
|
||||
d.update(dict(
|
||||
resp_code = f.response.code,
|
||||
resp_is_replay = f.response.is_replay(),
|
||||
resp_acked = f.response.reply.acked,
|
||||
resp_clen = contentdesc,
|
||||
resp_et = "{0:2.0f}ms".format(delta * 1000),
|
||||
resp_rate = "{0}/s".format(rate),
|
||||
))
|
||||
t = f.response.headers["content-type"]
|
||||
|
||||
Reference in New Issue
Block a user