From 54137e34460f55648e1476fb77879f0a67597d80 Mon Sep 17 00:00:00 2001 From: sakridge Date: Wed, 12 Aug 2020 14:07:05 -0700 Subject: [PATCH] Add incoming pull response counter (#11591) --- core/src/cluster_info.rs | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/core/src/cluster_info.rs b/core/src/cluster_info.rs index 1fb3cbeb08..bae3fdf3f8 100644 --- a/core/src/cluster_info.rs +++ b/core/src/cluster_info.rs @@ -242,6 +242,7 @@ struct GossipStats { push_message_count: Counter, push_message_value_count: Counter, push_response_count: Counter, + pull_requests_count: Counter, } pub struct ClusterInfo { @@ -1689,9 +1690,14 @@ impl ClusterInfo { } // process the collected pulls together - let rsp = self.handle_pull_requests(recycler, gossip_pull_data, stakes); - if let Some(rsp) = rsp { - let _ignore_disconnect = response_sender.send(rsp); + if !gossip_pull_data.is_empty() { + self.stats + .pull_requests_count + .add_relaxed(gossip_pull_data.len() as u64); + let rsp = self.handle_pull_requests(recycler, gossip_pull_data, stakes); + if let Some(rsp) = rsp { + let _ignore_disconnect = response_sender.send(rsp); + } } } @@ -2256,6 +2262,14 @@ impl ClusterInfo { i64 ), ); + datapoint_info!( + "cluster_info_stats5", + ( + "pull_requests_count", + self.stats.pull_requests_count.clear(), + i64 + ), + ); *last_print = Instant::now(); }