From e76a2065e37462c27b3ddf24a9c758a9ae79c17c Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 11 Aug 2020 22:27:35 +0000 Subject: [PATCH] Gossip log (#11555) (#11561) Co-authored-by: Carl (cherry picked from commit 1b238dd63e7522503dea78250c557706eaf90e7e) Co-authored-by: carllin --- core/src/cluster_info.rs | 12 ++++++------ core/src/crds_gossip_pull.rs | 4 +++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/core/src/cluster_info.rs b/core/src/cluster_info.rs index fc38c657da..7d6c2e8b70 100644 --- a/core/src/cluster_info.rs +++ b/core/src/cluster_info.rs @@ -1490,12 +1490,6 @@ impl ClusterInfo { .time_gossip_write_lock("purge", &self.stats.purge) .purge(timestamp(), &timeouts); inc_new_counter_info!("cluster_info-purge-count", num_purged); - let table_size = self.gossip.read().unwrap().crds.table.len(); - datapoint_debug!( - "cluster_info-purge", - ("table_size", table_size as i64, i64), - ("purge_stake_timeout", timeout as i64, i64) - ); } /// randomly pick a node and ask them for updates asynchronously @@ -2085,6 +2079,10 @@ impl ClusterInfo { fn print_reset_stats(&self, last_print: &mut Instant) { if last_print.elapsed().as_millis() > 2000 { + let (table_size, purged_values_size) = { + let r_gossip = self.gossip.read().unwrap(); + (r_gossip.crds.table.len(), r_gossip.pull.purged_values.len()) + }; datapoint_info!( "cluster_info_stats", ("entrypoint", self.stats.entrypoint.clear(), i64), @@ -2108,6 +2106,8 @@ impl ClusterInfo { self.stats.new_push_requests_num.clear(), i64 ), + ("table_size", table_size as i64, i64), + ("purged_values_size", purged_values_size as i64, i64), ); datapoint_info!( "cluster_info_stats2", diff --git a/core/src/crds_gossip_pull.rs b/core/src/crds_gossip_pull.rs index 8b06928afd..ac4979d4be 100644 --- a/core/src/crds_gossip_pull.rs +++ b/core/src/crds_gossip_pull.rs @@ -131,7 +131,7 @@ pub struct CrdsGossipPull { /// timestamp of last request pub pull_request_time: HashMap, /// hash and insert time - purged_values: VecDeque<(Hash, u64)>, + pub purged_values: VecDeque<(Hash, u64)>, pub crds_timeout: u64, pub msg_timeout: u64, pub num_pulls: usize, @@ -365,8 +365,10 @@ impl CrdsGossipPull { for (value_hash, _insert_timestamp) in &self.purged_values { filters.iter_mut().for_each(|filter| filter.add(value_hash)); } + filters } + /// filter values that fail the bloom filter up to max_bytes fn filter_crds_values( &self,