measure ws connect time
This commit is contained in:
parent
df3f5e170b
commit
7f6e946c2b
|
@ -49,13 +49,15 @@ export default class StreamingClient extends NanoEvents {
|
||||||
}
|
}
|
||||||
|
|
||||||
connect () {
|
connect () {
|
||||||
|
const begin = Date.now()
|
||||||
log('connecting')
|
log('connecting')
|
||||||
|
|
||||||
const ws = this.ws = new WebSocket(this.url)
|
const ws = this.ws = new WebSocket(this.url)
|
||||||
window.ws = ws
|
window.ws = ws
|
||||||
|
|
||||||
ws.onopen = () => {
|
ws.onopen = () => {
|
||||||
log('connected')
|
const took = Date.now() - begin
|
||||||
|
log(`connected (took ${took}ms)`)
|
||||||
this.subscribe()
|
this.subscribe()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue