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 | 803c2a528b25c5bf983130a9826bdcbfdc394ba6 (patch) | |
| tree | c845006c23c744706f4af0ebc5086acb7420c56d /src/api/dashboard/mod.rs | |
| parent | d661f9e001a5b7866d67756a24cb66885471195d (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) |
