diff options
Diffstat (limited to 'src/api')
| -rw-r--r-- | src/api/stats.rs | 4 | ||||
| -rw-r--r-- | src/api/stats/prometheus.rs | 6 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/api/stats.rs b/src/api/stats.rs index a34d4ed..fabbffd 100644 --- a/src/api/stats.rs +++ b/src/api/stats.rs @@ -114,6 +114,9 @@ struct SyncStats { last_from_neighbour_secs: Option<u64>, /// Peers whose heads differ from ours while sync is idle (`peers.md`, healing). diverged_peers: usize, + /// The largest sync message received since start (its Automerge part). Larger + /// transfers come as deltas (blobs). + largest_received_bytes: u64, } /// Passing changes on (`swarm::relay`) and serving blobs, since start. @@ -256,6 +259,7 @@ async fn collect(state: &AppState) -> StatsResponse { sync: SyncStats { last_from_neighbour_secs: last_from_neighbour.map(|at| at.elapsed().as_secs()), diverged_peers, + largest_received_bytes: node.largest_sync_received, }, relay: RelayStats { announce_rounds: node.relay.announce_rounds, diff --git a/src/api/stats/prometheus.rs b/src/api/stats/prometheus.rs index 30bb966..f9eb3bf 100644 --- a/src/api/stats/prometheus.rs +++ b/src/api/stats/prometheus.rs @@ -323,6 +323,12 @@ pub(super) async fn render(state: &AppState, stats: &StatsResponse) -> String { ); } out.single( + "largest_sync_received_bytes", + "gauge", + "The largest sync message received since start; larger transfers come as deltas.", + stats.sync.largest_received_bytes as f64, + ); + out.single( "diverged_peers", "gauge", "Peers whose heads differ from ours while sync is idle.", |
