diff options
| author | tv <tv@krebsco.de> | 2026-10-31 04:11:45 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-10-31 04:11:45 +0100 |
| commit | daa2efbc82d713f46f9c7e9999f52fe3319a575a (patch) | |
| tree | 254b8ccf218754d6ed991a1144b4c6a73f24ed41 /src/api/dashboard/mod.rs | |
| parent | 2dcd7449af4d8336fc598023fbc24590618aa7f2 (diff) | |
compute per-peer totals in /admin/stats once
Diffstat (limited to 'src/api/dashboard/mod.rs')
| -rw-r--r-- | src/api/dashboard/mod.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/api/dashboard/mod.rs b/src/api/dashboard/mod.rs index ad907ed..0a15570 100644 --- a/src/api/dashboard/mod.rs +++ b/src/api/dashboard/mod.rs @@ -257,8 +257,10 @@ impl Graph { /// The snapshot: the node, its figures, its peers, and the map. async fn build(state: &AppState, graph: &Graph) -> JsonValue { - let stats = serde_json::to_value(super::stats::collect(state).await).unwrap_or_default(); - let peers = serde_json::to_value(super::peers::peer_list(state).await).unwrap_or_default(); + // The peers once, for their list and the figures' totals over them. + let list = super::peers::peer_list(state).await; + let stats = serde_json::to_value(super::stats::collect(state, &list).await).unwrap_or_default(); + let peers = serde_json::to_value(&list).unwrap_or_default(); let aliases = { let replica = state.doc.read().await; members::aliases(&replica.doc) |
