Improve /api/v5/monitor endpoint performance.
Prior to this enhancement, the dashboard monitor page often timeout when there are many nodes in the cluster.
Below are detailed changes:
- Make concurrent RPC calls towards nodes in the cluster to retrieve metrics.
- Data points are downsampled to reduce dencity.
Dencity is adjusted according to the requested time span in the query:
10s when query the last 1h
1m when query the last 1d
5m when query the last 3d
10m when query the last 7d
- Insert dummy data points for gaps in the timeline (if EMQX has stopped for a while), so the gap will be visible in the dashboard.