From 7f6e946c2b7aa4f0f4f881e89951267bb1aa4ea7 Mon Sep 17 00:00:00 2001 From: slice Date: Wed, 18 Jul 2018 12:24:48 -0700 Subject: [PATCH] measure ws connect time --- priv/frontend/src/ws/client.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/priv/frontend/src/ws/client.js b/priv/frontend/src/ws/client.js index fd773be..d42ce61 100644 --- a/priv/frontend/src/ws/client.js +++ b/priv/frontend/src/ws/client.js @@ -49,13 +49,15 @@ export default class StreamingClient extends NanoEvents { } connect () { + const begin = Date.now() log('connecting') const ws = this.ws = new WebSocket(this.url) window.ws = ws ws.onopen = () => { - log('connected') + const took = Date.now() - begin + log(`connected (took ${took}ms)`) this.subscribe() }