Skip to content

ratman/dashboard: Refresh models periodically

embr requested to merge feature/dashboard-refresh into develop

Issue Fix

Follow-up to #56 (closed)

Description

Having auto-updating metrics on the front page is imo neat, and also kind of necessary because of how the metrics work (deltas between polls).

But if one thing is visibly auto-updating, and nothing else does (new peers need a full-page load to show up), that's not neat, it's just confusing UX.

This polls the model of all active routes for updates every 5s, waiting for the previous refresh to finish before kicking off another one to avoid a thundering herd.

Alternative(s) considered

We could do something way more elaborate here, like long polling or a websocket connection, but that feels overkill for the amount of load this is actually likely to cause - we're expecting one concurrent user, on the same machine as the daemon, making 2 requests (metrics + model) every 5s.

If the dashboard ends up needing a lot more data, or otherwise cause load issues on the daemon, then we could look into making this more efficient.

Type

Choose one: Feature

Screenshots (if applicable)

Merge request reports