removes metric for process_push_success (#29211)

This is already tracked in CrdsDataStats:
https://github.com/solana-labs/solana/blob/5e799ad56/gossip/src/crds.rs#L96-L106
https://github.com/solana-labs/solana/blob/5e799ad56/gossip/src/cluster_info_metrics.rs#L652-L656
and is so duplicated.
Removing the metric would simplify this code path for upcoming commits.
This commit is contained in:
behzad nouri 2022-12-12 22:10:38 +00:00 committed by GitHub
parent 536b879aa7
commit 8ea5dd8b28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 28 deletions

View File

@ -2266,12 +2266,7 @@ impl ClusterInfo {
messages
.into_iter()
.flat_map(|(from, crds_values)| {
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
self.gossip.process_push_message(&from, crds_values, now)
})
.collect()
};

View File

@ -156,7 +156,6 @@ pub struct GossipStats {
pub(crate) process_pull_response_success: Counter,
pub(crate) process_pull_response_timeout: Counter,
pub(crate) process_push_message: Counter,
pub(crate) process_push_success: Counter,
pub(crate) prune_message_count: Counter,
pub(crate) prune_message_len: Counter,
pub(crate) prune_message_timeout: Counter,
@ -235,11 +234,6 @@ pub(crate) fn submit_gossip_stats(
("repair_peers", stats.repair_peers.clear(), i64),
("new_push_requests", stats.new_push_requests.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_count", stats.purge_count.clear(), i64),
(

View File

@ -50,22 +50,12 @@ impl CrdsGossip {
from: &Pubkey,
values: Vec<CrdsValue>,
now: u64,
) -> (usize, HashSet<Pubkey>) {
let results = self
.push
.process_push_message(&self.crds, from, values, now);
let mut success_count = 0;
let successfully_inserted_origin_set: HashSet<Pubkey> = results
) -> HashSet<Pubkey> {
self.push
.process_push_message(&self.crds, from, values, now)
.into_iter()
.filter_map(|result| {
if result.is_ok() {
success_count += 1;
}
Result::ok(result)
})
.collect();
(success_count, successfully_inserted_origin_set)
.filter_map(Result::ok)
.collect()
}
/// Remove redundant paths in the network.

View File

@ -365,7 +365,6 @@ fn network_run_push(
.unwrap()
.gossip
.process_push_message(&from, msgs.clone(), now)
.1
.into_iter()
.collect();
let prunes_map = network