diff options
| author | tv <tv@krebsco.de> | 2026-10-30 17:33:59 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-10-30 17:33:59 +0100 |
| commit | 287c4e4832709ab4137e4786e593466390eadd53 (patch) | |
| tree | 3d02153efac95ad6a50e4dcda5c5d31fdba83d56 /src/api/stats.rs | |
| parent | a903c25b548490dc5fa48f398f6ddfdeca2270c6 (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.rs | 3 |
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) = { |
