added timing information to FlowDetailView
This commit is contained in:
parent
58dba3f490
commit
f514eacd7a
|
@ -35,14 +35,37 @@ class FlowDetailsView(urwid.ListBox):
|
||||||
title = urwid.AttrWrap(title, "heading")
|
title = urwid.AttrWrap(title, "heading")
|
||||||
text.append(title)
|
text.append(title)
|
||||||
|
|
||||||
if self.flow.server_conn:
|
cc = self.flow.client_conn
|
||||||
|
sc = self.flow.server_conn
|
||||||
|
req = self.flow.request;
|
||||||
|
resp = self.flow.response;
|
||||||
|
|
||||||
|
timing_parts = []
|
||||||
|
if cc:
|
||||||
|
timing_parts.append(["Client conn. established", utils.format_timestamp_with_milli(cc.timestamp_start) if cc.timestamp_start else "active"])
|
||||||
|
if sc:
|
||||||
|
timing_parts.append(["Server conn. initiated", utils.format_timestamp_with_milli(sc.timestamp_start)])
|
||||||
|
timing_parts.append(["Server conn. TCP handshake", utils.format_timestamp_with_milli(sc.timestamp_tcp_setup) if sc.timestamp_tcp_setup else "active"])
|
||||||
|
if sc.ssl_established:
|
||||||
|
timing_parts.append(["Server conn. SSL handshake", utils.format_timestamp_with_milli(sc.timestamp_ssl_setup) if sc.timestamp_ssl_setup else "active"])
|
||||||
|
if cc:
|
||||||
|
if sc.ssl_established:
|
||||||
|
timing_parts.append(["Client conn. SSL handshake", utils.format_timestamp_with_milli(cc.timestamp_ssl_setup) if cc.timestamp_ssl_setup else "active"])
|
||||||
|
|
||||||
|
timing_parts.append(["First request byte", utils.format_timestamp_with_milli(req.timestamp_start)])
|
||||||
|
timing_parts.append(["Request complete", utils.format_timestamp_with_milli(req.timestamp_end) if req.timestamp_end else "active"])
|
||||||
|
|
||||||
|
if resp:
|
||||||
|
timing_parts.append(["First response byte", utils.format_timestamp_with_milli(resp.timestamp_start)])
|
||||||
|
timing_parts.append(["response complete", utils.format_timestamp_with_milli(resp.timestamp_end) if resp.timestamp_end else "active"])
|
||||||
|
|
||||||
|
|
||||||
|
if sc:
|
||||||
text.append(urwid.Text([("head", "Server Connection:")]))
|
text.append(urwid.Text([("head", "Server Connection:")]))
|
||||||
sc = self.flow.server_conn
|
|
||||||
parts = [
|
parts = [
|
||||||
["Address", "%s:%s" % sc.address()],
|
["Address", "%s:%s" % sc.address()],
|
||||||
["Start time", utils.format_timestamp_with_milli(sc.timestamp_start)],
|
|
||||||
["End time", utils.format_timestamp_with_milli(sc.timestamp_end) if sc.timestamp_end else "active"],
|
|
||||||
]
|
]
|
||||||
|
|
||||||
text.extend(common.format_keyvals(parts, key="key", val="text", indent=4))
|
text.extend(common.format_keyvals(parts, key="key", val="text", indent=4))
|
||||||
|
|
||||||
c = self.flow.server_conn.cert
|
c = self.flow.server_conn.cert
|
||||||
|
@ -79,15 +102,16 @@ class FlowDetailsView(urwid.ListBox):
|
||||||
)
|
)
|
||||||
text.extend(common.format_keyvals(parts, key="key", val="text", indent=4))
|
text.extend(common.format_keyvals(parts, key="key", val="text", indent=4))
|
||||||
|
|
||||||
if self.flow.client_conn:
|
if cc:
|
||||||
text.append(urwid.Text([("head", "Client Connection:")]))
|
text.append(urwid.Text([("head", "Client Connection:")]))
|
||||||
cc = self.flow.client_conn
|
|
||||||
parts = [
|
parts = [
|
||||||
["Address", "%s:%s" % cc.address()],
|
["Address", "%s:%s" % cc.address()],
|
||||||
["Start time", utils.format_timestamp_with_milli(cc.timestamp_start)],
|
|
||||||
# ["Requests", "%s"%cc.requestcount],
|
# ["Requests", "%s"%cc.requestcount],
|
||||||
["End time", utils.format_timestamp_with_milli(cc.timestamp_end) if cc.timestamp_end else "active"],
|
|
||||||
]
|
]
|
||||||
|
|
||||||
text.extend(common.format_keyvals(parts, key="key", val="text", indent=4))
|
text.extend(common.format_keyvals(parts, key="key", val="text", indent=4))
|
||||||
|
|
||||||
|
text.append(urwid.Text([("head", "Timing:")]))
|
||||||
|
text.extend(common.format_keyvals(timing_parts, key="key", val="text", indent=4))
|
||||||
return text
|
return text
|
||||||
|
|
Loading…
Reference in New Issue