From 5a3f389bd3521560b037a7e73d48242b5b123e16 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Mon, 17 Apr 2017 20:13:14 -0400 Subject: [PATCH] improve debug timeline data and visualization --- misc/web/timeline.js | 11 +++++++---- src/wormhole/_input.py | 2 ++ src/wormhole/cli/cmd_receive.py | 1 + 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/misc/web/timeline.js b/misc/web/timeline.js index 11051e3..96a508c 100644 --- a/misc/web/timeline.js +++ b/misc/web/timeline.js @@ -39,13 +39,15 @@ const server_message_color = { "allocated": 1, // receive "list": 2, // send - "channelids": 2, // receive + "nameplates": 2, // receive "claim": 3, // send - "watch": 4, // send + "claimed": 3, // receive - "deallocate": 5, // send - "deallocated": 5, // receive + "open": 4, // send + + "release": 5, // send + "released": 5, // receive "error": 6, // receive @@ -62,6 +64,7 @@ const proc_map = { "code established": "code-established", "key established": "key-established", "transit connected": "transit-connected", + "print": "print", "exit": "exit", "transit connect": "transit-connect", "import": "import" diff --git a/src/wormhole/_input.py b/src/wormhole/_input.py index 7fe8afd..34af1c5 100644 --- a/src/wormhole/_input.py +++ b/src/wormhole/_input.py @@ -70,6 +70,7 @@ class Input(object): @m.output() def do_start(self): + self._start_timing = self._timing.add("input code", waiting="user") self._L.refresh() return Helper(self) @m.output() @@ -136,6 +137,7 @@ class Input(object): @m.output() def do_words(self, words): code = self._nameplate + "-" + words + self._start_timing.finish() self._C.finished_input(code) S0_idle.upon(start, enter=S1_typing_nameplate, diff --git a/src/wormhole/cli/cmd_receive.py b/src/wormhole/cli/cmd_receive.py index 3407d49..9c85fe8 100644 --- a/src/wormhole/cli/cmd_receive.py +++ b/src/wormhole/cli/cmd_receive.py @@ -266,6 +266,7 @@ class Receiver: def _handle_text(self, them_d, w): # we're receiving a text message + self.args.timing.add("print") print(them_d["message"], file=self.args.stdout) self._send_data({"answer": {"message_ack": "ok"}}, w)