score:1

as far as i can tell, cubism wants to poll — and seems to be designed completely around polling, not event-driven pushes. a custom metric is simply meant to fetch data the context decides it wants, so you'd really have to write a custom context designed with things like server-sent events and long-polling/_changes feed architectures.

or!

why not write a custom metric that fakes it? basically, provide a context.metric request function that's closed around a buffer. as you get events, put them in the buffer. then when cubism's context gets around to polling your metric fetch function (you can set the clientdelay lower since now it won't actually increase network traffic) you can ± just shift the buffer out right away.


Related Query