nsq icon indicating copy to clipboard operation
nsq copied to clipboard

nsqadmin: update in real-time

Open pilwon opened this issue 11 years ago • 9 comments

It'd be great if we could see the numbers in nsqadmin (ex: Depth, Memory + Disk, Messages, Channels, etc.) updated in real-time via websocket.

pilwon avatar Aug 20 '14 20:08 pilwon

Chiming in here quick: websockets are unnecessary for this, as you don't need two way communication. Just use Server Sent Events. They're trivial to implement in Go.

paddycarver avatar Aug 25 '14 17:08 paddycarver

updated title :)

mreiferson avatar Aug 25 '14 17:08 mreiferson

They also are easier to operate. No worrying about reconnect logic, they mostly "just work" for streaming updates.

paddycarver avatar Aug 25 '14 17:08 paddycarver

:+1:

jamesfzhang avatar Aug 29 '14 17:08 jamesfzhang

+1

zygis avatar Oct 08 '14 13:10 zygis

Websockets have marginally more support across browsers (latest IE versions being the notable one missing from Server Sent Events).

http://caniuse.com/#search=server vs http://caniuse.com/#search=websocket

Does anybody have any significant opinion on which to use, with that in mind?

stephens2424 avatar Oct 21 '14 17:10 stephens2424

I would say whichever is simpler to implement - I'm not terribly concerned about IE compatibility, for example.

mreiferson avatar Oct 21 '14 17:10 mreiferson

I'd say SSE--implementing it in Go is trivial, the client-side code is simpler (no need to manage connection state, etc.) and the main advantage of WS (the client can talk to the server) isn't something nsqadmin actually needs.

paddycarver avatar Oct 21 '14 18:10 paddycarver

It's less elegant than a full SSE implementation, but as part of #323 it should be trivial to implement an automatic refresh on a configurable timer, with the client re-polling for new data over the nsqadmind REST endpoints. I think SSE should be tackled in a separate commit for this issue after that initial refactoring, but welcome input in #323 if there are any suggestions/concerns with that sort of interim solution.

allgeek avatar Nov 08 '14 17:11 allgeek