From 236a11a4798574b9c710dde4b97231ff4cade86d Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 30 Oct 2026 17:33:59 +0100 Subject: build stats and peers as values Both /admin/stats and /peers can now be built as plain values (stats::collect, peers::peer_list), so the upcoming dashboard can reuse them. --- src/api/stats.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/api/stats.rs') diff --git a/src/api/stats.rs b/src/api/stats.rs index 889b675..114f644 100644 --- a/src/api/stats.rs +++ b/src/api/stats.rs @@ -249,7 +249,8 @@ pub(crate) async fn get_stats(State(state): State, headers: HeaderMap) } } -async fn collect(state: &AppState) -> StatsResponse { +/// What `GET /admin/stats` answers as JSON, for others to show too (the dashboard). +pub(crate) async fn collect(state: &AppState) -> StatsResponse { let node = state.stats.snapshot(); let (heads, tier, remakes) = { -- cgit v1.3.1