Problem
NetworkService.GetLatestStatistics calls GetStatistics, which requests /vnet_monitor_stats_history_short with sort=-timestamp&limit=100, then returns only stats[0]. Every "latest" lookup transfers 100 rows to use one.
For consumers polling latest stats for many networks per scrape (e.g. the exporter's VNetCollector, verge-io/vergeos-exporter#53), that's 100x the necessary payload per network. The exporter bounds this with concurrency, but the per-request waste remains.
Request
Either:
- Make
GetLatestStatistics issue its own query with limit=1 (same filter/sort), or
- Add a bulk variant, e.g.
GetLatestStatisticsAll(ctx) (map[int]NetworkMonitorStats, error), that fetches the latest row per vnet in one request — this would let the exporter drop the per-network fan-out entirely.
The bulk variant is the more valuable of the two if the API can express it.
Problem
NetworkService.GetLatestStatisticscallsGetStatistics, which requests/vnet_monitor_stats_history_shortwithsort=-timestamp&limit=100, then returns onlystats[0]. Every "latest" lookup transfers 100 rows to use one.For consumers polling latest stats for many networks per scrape (e.g. the exporter's VNetCollector, verge-io/vergeos-exporter#53), that's 100x the necessary payload per network. The exporter bounds this with concurrency, but the per-request waste remains.
Request
Either:
GetLatestStatisticsissue its own query withlimit=1(same filter/sort), orGetLatestStatisticsAll(ctx) (map[int]NetworkMonitorStats, error), that fetches the latest row per vnet in one request — this would let the exporter drop the per-network fan-out entirely.The bulk variant is the more valuable of the two if the API can express it.