Add incoming pull response counter (#11591)

This commit is contained in:
sakridge 2020-08-12 14:07:05 -07:00 committed by GitHub
parent bb8ccbb022
commit 54137e3446
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 17 additions and 3 deletions

View File

@ -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();
}