Add metric measuring number of successfully inserted push messages (#20275)
* Add number of successfully inserted push messages
This commit is contained in:
parent
491877de3d
commit
ee8621a8bd
|
@ -2181,7 +2181,12 @@ impl ClusterInfo {
|
||||||
messages
|
messages
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.flat_map(|(from, crds_values)| {
|
.flat_map(|(from, crds_values)| {
|
||||||
self.gossip.process_push_message(&from, crds_values, now)
|
let (num_success, origins) =
|
||||||
|
self.gossip.process_push_message(&from, crds_values, now);
|
||||||
|
self.stats
|
||||||
|
.process_push_success
|
||||||
|
.add_relaxed(num_success as u64);
|
||||||
|
origins
|
||||||
})
|
})
|
||||||
.collect()
|
.collect()
|
||||||
};
|
};
|
||||||
|
|
|
@ -131,6 +131,7 @@ pub(crate) struct GossipStats {
|
||||||
pub(crate) process_pull_response_success: Counter,
|
pub(crate) process_pull_response_success: Counter,
|
||||||
pub(crate) process_pull_response_timeout: Counter,
|
pub(crate) process_pull_response_timeout: Counter,
|
||||||
pub(crate) process_push_message: Counter,
|
pub(crate) process_push_message: Counter,
|
||||||
|
pub(crate) process_push_success: Counter,
|
||||||
pub(crate) prune_message_count: Counter,
|
pub(crate) prune_message_count: Counter,
|
||||||
pub(crate) prune_message_len: Counter,
|
pub(crate) prune_message_len: Counter,
|
||||||
pub(crate) prune_received_cache: Counter,
|
pub(crate) prune_received_cache: Counter,
|
||||||
|
@ -199,6 +200,11 @@ pub(crate) fn submit_gossip_stats(
|
||||||
("repair_peers", stats.repair_peers.clear(), i64),
|
("repair_peers", stats.repair_peers.clear(), i64),
|
||||||
("new_push_requests", stats.new_push_requests.clear(), i64),
|
("new_push_requests", stats.new_push_requests.clear(), i64),
|
||||||
("new_push_requests2", stats.new_push_requests2.clear(), i64),
|
("new_push_requests2", stats.new_push_requests2.clear(), i64),
|
||||||
|
(
|
||||||
|
"process_push_success",
|
||||||
|
stats.process_push_success.clear(),
|
||||||
|
i64
|
||||||
|
),
|
||||||
("purge", stats.purge.clear(), i64),
|
("purge", stats.purge.clear(), i64),
|
||||||
(
|
(
|
||||||
"process_gossip_packets_time",
|
"process_gossip_packets_time",
|
||||||
|
|
|
@ -49,12 +49,22 @@ impl CrdsGossip {
|
||||||
from: &Pubkey,
|
from: &Pubkey,
|
||||||
values: Vec<CrdsValue>,
|
values: Vec<CrdsValue>,
|
||||||
now: u64,
|
now: u64,
|
||||||
) -> HashSet<Pubkey> {
|
) -> (usize, HashSet<Pubkey>) {
|
||||||
self.push
|
let results = self
|
||||||
.process_push_message(&self.crds, from, values, now)
|
.push
|
||||||
|
.process_push_message(&self.crds, from, values, now);
|
||||||
|
let mut success_count = 0;
|
||||||
|
let successfully_inserted_origin_set: HashSet<Pubkey> = results
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.filter_map(Result::ok)
|
.filter_map(|result| {
|
||||||
.collect()
|
if result.is_ok() {
|
||||||
|
success_count += 1;
|
||||||
|
}
|
||||||
|
Result::ok(result)
|
||||||
|
})
|
||||||
|
.collect();
|
||||||
|
|
||||||
|
(success_count, successfully_inserted_origin_set)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Remove redundant paths in the network.
|
/// Remove redundant paths in the network.
|
||||||
|
|
|
@ -357,6 +357,7 @@ fn network_run_push(
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.gossip
|
.gossip
|
||||||
.process_push_message(&from, msgs.clone(), now)
|
.process_push_message(&from, msgs.clone(), now)
|
||||||
|
.1
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.collect();
|
.collect();
|
||||||
let prunes_map = network
|
let prunes_map = network
|
||||||
|
|
Loading…
Reference in New Issue