From 19461552f88e8b82a24c63c00a6591996ae8f45d Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 6 Nov 2026 06:58:48 +0100 Subject: trees at runtime --- src/api/stats.rs | 7 +++++++ src/api/stats/prometheus.rs | 12 ++++++++++++ 2 files changed, 19 insertions(+) (limited to 'src/api') diff --git a/src/api/stats.rs b/src/api/stats.rs index 2af6549..8eaff0c 100644 --- a/src/api/stats.rs +++ b/src/api/stats.rs @@ -146,6 +146,11 @@ struct RelayStats { pulls_queued: u64, /// Changes passed on along writers' trees, per child (`swarm::tree`). tree_forwards: u64, + /// Sync messages along a writer's tree, carrying changes, from a peer other than our + /// parent in it; and changes of writers in whose trees we have a parent that came + /// another way (`tree::note_arrival`). + tree_from_others: u64, + tree_missed: u64, /// Blob requests not answered: too many were being answered. blob_requests_dropped: u64, } @@ -374,6 +379,8 @@ pub(crate) async fn collect(state: &AppState, list: &PeerListResponse) -> StatsR pulls: node.relay.pulls, pulls_queued: node.relay.pulls_queued, tree_forwards: node.relay.tree_forwards, + tree_from_others: node.relay.tree_from_others, + tree_missed: node.relay.tree_missed, blob_requests_dropped: node.blob_requests_dropped, }, topology: TopologyStats { diff --git a/src/api/stats/prometheus.rs b/src/api/stats/prometheus.rs index fb8b890..8b8ca1c 100644 --- a/src/api/stats/prometheus.rs +++ b/src/api/stats/prometheus.rs @@ -668,6 +668,18 @@ pub(super) fn render(stats: &StatsResponse, list: &PeerListResponse) -> String { "Changes passed on along writers' trees, per child.", relay.tree_forwards as f64, ); + out.single( + "tree_from_others_total", + "counter", + "Sync messages along a writer's tree, carrying changes, from a peer other than our parent in it.", + relay.tree_from_others as f64, + ); + out.single( + "tree_missed_total", + "counter", + "Changes of writers in whose trees we have a parent that came another way.", + relay.tree_missed as f64, + ); out.single( "blob_requests_dropped_total", "counter", -- cgit v1.3.1