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.


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