Merge branch 'JS-timing'
This commit is contained in:
		
						commit
						d11af9d0a6
					
				|  | @ -48,6 +48,10 @@ rect.proc-span-import { | ||||||
|     fill: #fcc; |     fill: #fcc; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | rect.proc-span-websocket { | ||||||
|  |     fill: #cfc; | ||||||
|  | } | ||||||
|  | 
 | ||||||
| rect.api { | rect.api { | ||||||
|     fill: #cfc; |     fill: #cfc; | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -57,6 +57,7 @@ const server_message_color = { | ||||||
| 
 | 
 | ||||||
| const proc_map = { | const proc_map = { | ||||||
|     "command dispatch": "dispatch", |     "command dispatch": "dispatch", | ||||||
|  |     "open websocket": "websocket", | ||||||
|     "code established": "code-established", |     "code established": "code-established", | ||||||
|     "key established": "key-established", |     "key established": "key-established", | ||||||
|     "transit connected": "transit-connected", |     "transit connected": "transit-connected", | ||||||
|  | @ -135,6 +136,8 @@ d3.json("data.json", function(d) { | ||||||
|         if (proc_map[e.name]) { |         if (proc_map[e.name]) { | ||||||
|             rel_e.category = "proc"; |             rel_e.category = "proc"; | ||||||
|             rel_e.x = x_offset(3, side_name); |             rel_e.x = x_offset(3, side_name); | ||||||
|  |             if (e.name === "open websocket") | ||||||
|  |                 rel_e.x = x_offset(4, side_name); | ||||||
|             rel_e.text = proc_map[e.name]; |             rel_e.text = proc_map[e.name]; | ||||||
|             if (e.name === "import") |             if (e.name === "import") | ||||||
|                 rel_e.text += " " + e.details.which; |                 rel_e.text += " " + e.details.which; | ||||||
|  | @ -184,8 +187,8 @@ d3.json("data.json", function(d) { | ||||||
|         } else if (ev.name === "ws_receive") { |         } else if (ev.name === "ws_receive") { | ||||||
|             if (ev.details.message.type !== "message") |             if (ev.details.message.type !== "message") | ||||||
|                 return; |                 return; | ||||||
|             id = ev.details.message.message.id; |             id = ev.details.message.id; | ||||||
|             phase = ev.details.message.message.phase; |             phase = ev.details.message.phase; | ||||||
|         } else |         } else | ||||||
|             return; |             return; | ||||||
| 
 | 
 | ||||||
|  | @ -205,7 +208,7 @@ d3.json("data.json", function(d) { | ||||||
|             cm.tx_x = x_offset(TX_COLUMN, ev.side_name); |             cm.tx_x = x_offset(TX_COLUMN, ev.side_name); | ||||||
|             cm.tx_side_name = ev.side_name; |             cm.tx_side_name = ev.side_name; | ||||||
|         } else { // message
 |         } else { // message
 | ||||||
|             cm.server_rx = ev.details.message.message.server_rx - first; |             cm.server_rx = ev.details.message.server_rx - first; | ||||||
|             cm.arrivals.push({server_tx: ev.details.message.server_tx - first, |             cm.arrivals.push({server_tx: ev.details.message.server_tx - first, | ||||||
|                               rx: ev.start, |                               rx: ev.start, | ||||||
|                               rx_x: x_offset(RX_COLUMN, ev.side_name)}); |                               rx_x: x_offset(RX_COLUMN, ev.side_name)}); | ||||||
|  | @ -508,7 +511,7 @@ d3.json("data.json", function(d) { | ||||||
|             chart.selectAll("circle.c2c").filter(d => d.col == dot.col) |             chart.selectAll("circle.c2c").filter(d => d.col == dot.col) | ||||||
|                 .attr("r", 10); |                 .attr("r", 10); | ||||||
|             chart.selectAll("line.c2c") |             chart.selectAll("line.c2c") | ||||||
|                 .classed("active", d => d[2] == dot.col); |                 .classed("active", d => d.col == dot.col); | ||||||
|         }) |         }) | ||||||
|         .on("mouseout", dot => { |         .on("mouseout", dot => { | ||||||
|             tip.hide(dot); |             tip.hide(dot); | ||||||
|  | @ -703,7 +706,26 @@ d3.json("data.json", function(d) { | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|     redraw(); |     redraw(); | ||||||
|     return; | }); | ||||||
|  | 
 | ||||||
|  | /* | ||||||
|  | TODO | ||||||
|  | 
 | ||||||
|  | * identify the largest gaps in the timeline (biggest is probably waiting for | ||||||
|  |   the recipient to start the program, followed by waiting for recipient to | ||||||
|  |   type in code, followed by waiting for recipient to approve transfer, with | ||||||
|  |   the time of actual transfer being anywhere among the others). | ||||||
|  | * identify groups of events that are separated by those gaps | ||||||
|  | * put a [1 2 3 4 all] set of buttons at the top of the page | ||||||
|  | * clicking on each button will zoom the display to 10% beyond the span of | ||||||
|  |   events in the given group, or reset the zoom to include all events | ||||||
|  | 
 | ||||||
|  | */ | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | function OFF() { | ||||||
|  |     /* leftover code from an older implementation, retained since there might | ||||||
|  |     still be some useful pieces here */ | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|     function y_off(d) { |     function y_off(d) { | ||||||
|  | @ -1036,18 +1058,4 @@ d3.json("data.json", function(d) { | ||||||
| 
 | 
 | ||||||
|     redraw(); |     redraw(); | ||||||
|     $.get("done", function(_) {}); |     $.get("done", function(_) {}); | ||||||
| }); | } | ||||||
| 
 |  | ||||||
| /* |  | ||||||
| TODO |  | ||||||
| 
 |  | ||||||
| * identify the largest gaps in the timeline (biggest is probably waiting for |  | ||||||
|   the recipient to start the program, followed by waiting for recipient to |  | ||||||
|   type in code, followed by waiting for recipient to approve transfer, with |  | ||||||
|   the time of actual transfer being anywhere among the others). |  | ||||||
| * identify groups of events that are separated by those gaps |  | ||||||
| * put a [1 2 3 4 all] set of buttons at the top of the page |  | ||||||
| * clicking on each button will zoom the display to 10% beyond the span of |  | ||||||
|   events in the given group, or reset the zoom to include all events |  | ||||||
| 
 |  | ||||||
| */ |  | ||||||
|  |  | ||||||
|  | @ -223,6 +223,7 @@ class _Wormhole: | ||||||
|         self._side = bytes_to_hexstr(os.urandom(5)) |         self._side = bytes_to_hexstr(os.urandom(5)) | ||||||
|         self._connection_state = CLOSED |         self._connection_state = CLOSED | ||||||
|         self._connection_waiters = [] |         self._connection_waiters = [] | ||||||
|  |         self._ws_t = None | ||||||
|         self._started_get_code = False |         self._started_get_code = False | ||||||
|         self._get_code = None |         self._get_code = None | ||||||
|         self._started_input_code = False |         self._started_input_code = False | ||||||
|  | @ -350,6 +351,7 @@ class _Wormhole: | ||||||
|         # state |         # state | ||||||
|         assert self._side |         assert self._side | ||||||
|         self._connection_state = OPENING |         self._connection_state = OPENING | ||||||
|  |         self._ws_t = self._timing.add("open websocket") | ||||||
|         p = urlparse(self._ws_url) |         p = urlparse(self._ws_url) | ||||||
|         f = WSFactory(self._ws_url) |         f = WSFactory(self._ws_url) | ||||||
|         f.wormhole = self |         f.wormhole = self | ||||||
|  | @ -369,7 +371,7 @@ class _Wormhole: | ||||||
| 
 | 
 | ||||||
|     def _event_connected(self, ws): |     def _event_connected(self, ws): | ||||||
|         self._ws = ws |         self._ws = ws | ||||||
|         self._ws_t = self._timing.add("websocket") |         self._ws_t.finish() | ||||||
| 
 | 
 | ||||||
|     def _event_ws_opened(self, _): |     def _event_ws_opened(self, _): | ||||||
|         self._connection_state = OPEN |         self._connection_state = OPEN | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user