aboutsummaryrefslogtreecommitdiffstats
path: root/src/api/stats.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-10-30 17:33:59 +0100
committertv <tv@krebsco.de>2026-10-30 17:33:59 +0100
commit236a11a4798574b9c710dde4b97231ff4cade86d (patch)
tree1203102bc44aa9bcc002646934d59c5a3f3bcd83 /src/api/stats.rs
parentf091fb2a9188f686e5b1f9012c510a1b3c8ad840 (diff)
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.
Diffstat (limited to 'src/api/stats.rs')
-rw-r--r--src/api/stats.rs3
1 files changed, 2 insertions, 1 deletions
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<AppState>, 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) = {