diff options
| author | tv <tv@krebsco.de> | 2026-11-03 03:26:15 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-03 03:26:15 +0100 |
| commit | 5b3d9cbd1bba986b06978bef0100d349b33e74c7 (patch) | |
| tree | bb441a8636a3a01da6319b9f6c64e0695d0729b1 /src/api | |
| parent | 2b4359f23d20b14bae1896512f678d02b7f3c34c (diff) | |
add eager link counters
Diffstat (limited to 'src/api')
| -rw-r--r-- | src/api/stats.rs | 8 | ||||
| -rw-r--r-- | src/api/stats/prometheus.rs | 18 |
2 files changed, 26 insertions, 0 deletions
diff --git a/src/api/stats.rs b/src/api/stats.rs index 558507a..9ac2c94 100644 --- a/src/api/stats.rs +++ b/src/api/stats.rs @@ -140,6 +140,11 @@ struct RelayStats { pulls: u64, /// Announcements of heads we lacked that waited for the pull in progress. pulls_queued: u64, + /// Links made eager, and lazy again (`swarm::relay`). + grafts: u64, + prunes: u64, + /// Changes forwarded over eager links, per neighbour. + eager_forwards: u64, /// Blob requests not answered: too many were being answered. blob_requests_dropped: u64, } @@ -340,6 +345,9 @@ pub(crate) async fn collect(state: &AppState, list: &PeerListResponse) -> StatsR announce_rounds: node.relay.announce_rounds, pulls: node.relay.pulls, pulls_queued: node.relay.pulls_queued, + grafts: node.relay.grafts, + prunes: node.relay.prunes, + eager_forwards: node.relay.eager_forwards, blob_requests_dropped: node.blob_requests_dropped, }, topology: TopologyStats { diff --git a/src/api/stats/prometheus.rs b/src/api/stats/prometheus.rs index 0a1d75d..3d4bcc6 100644 --- a/src/api/stats/prometheus.rs +++ b/src/api/stats/prometheus.rs @@ -651,6 +651,24 @@ pub(super) fn render(stats: &StatsResponse, list: &PeerListResponse) -> String { relay.pulls_queued as f64, ); out.single( + "grafts_total", + "counter", + "Links made eager: a pull brought changes over them.", + relay.grafts as f64, + ); + out.single( + "prunes_total", + "counter", + "Links made lazy again: changes came over them that another path brought first.", + relay.prunes as f64, + ); + out.single( + "eager_forwards_total", + "counter", + "Changes forwarded over eager links, per neighbour.", + relay.eager_forwards as f64, + ); + out.single( "blob_requests_dropped_total", "counter", "Blob requests not answered: too many were being answered.", |
