Add incoming pull response counter (#11591) (#11592)

(cherry picked from commit 54137e3446)

Co-authored-by: sakridge <sakridge@gmail.com>
This commit is contained in:
mergify[bot]
2020-08-12 22:17:50 +00:00
committed by GitHub
parent b9f46fd904
commit 311d9a56c4

View File

@@ -242,6 +242,7 @@ struct GossipStats {
push_message_count: Counter, push_message_count: Counter,
push_message_value_count: Counter, push_message_value_count: Counter,
push_response_count: Counter, push_response_count: Counter,
pull_requests_count: Counter,
} }
pub struct ClusterInfo { pub struct ClusterInfo {
@@ -1688,9 +1689,14 @@ impl ClusterInfo {
} }
// process the collected pulls together // process the collected pulls together
let rsp = self.handle_pull_requests(recycler, gossip_pull_data, stakes); if !gossip_pull_data.is_empty() {
if let Some(rsp) = rsp { self.stats
let _ignore_disconnect = response_sender.send(rsp); .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);
}
} }
} }
@@ -2255,6 +2261,14 @@ impl ClusterInfo {
i64 i64
), ),
); );
datapoint_info!(
"cluster_info_stats5",
(
"pull_requests_count",
self.stats.pull_requests_count.clear(),
i64
),
);
*last_print = Instant::now(); *last_print = Instant::now();
} }