Rate limit counter metrics points to one per second (#5496)

* Rate limit counter metrics points to one per second

* Remove old env var

* Test that metrics counter is incrementing

* Fix typo
This commit is contained in:
Justin Starry
2019-08-12 18:15:34 -04:00
committed by GitHub
parent 771d1a78fd
commit 0fde19239b
12 changed files with 209 additions and 163 deletions

View File

@ -228,13 +228,10 @@ impl BankingStage {
(new_tx_count as f32) / (proc_start.as_s())
);
inc_new_high_rate_counter_info!("banking_stage-rebuffered_packets", rebuffered_packets);
inc_new_high_rate_counter_info!("banking_stage-consumed_buffered_packets", new_tx_count);
inc_new_high_rate_counter_debug!("banking_stage-process_transactions", new_tx_count);
inc_new_high_rate_counter_debug!(
"banking_stage-dropped_batches_count",
dropped_batches_count
);
inc_new_counter_info!("banking_stage-rebuffered_packets", rebuffered_packets);
inc_new_counter_info!("banking_stage-consumed_buffered_packets", new_tx_count);
inc_new_counter_debug!("banking_stage-process_transactions", new_tx_count);
inc_new_counter_debug!("banking_stage-dropped_batches_count", dropped_batches_count);
Ok(unprocessed_packets)
}
@ -813,7 +810,7 @@ impl BankingStage {
count,
id,
);
inc_new_high_rate_counter_debug!("banking_stage-transactions_received", count);
inc_new_counter_debug!("banking_stage-transactions_received", count);
let mut proc_start = Measure::start("process_received_packets_process");
let mut new_tx_count = 0;
@ -885,12 +882,9 @@ impl BankingStage {
count,
id,
);
inc_new_high_rate_counter_debug!("banking_stage-process_packets", count);
inc_new_high_rate_counter_debug!("banking_stage-process_transactions", new_tx_count);
inc_new_high_rate_counter_debug!(
"banking_stage-dropped_batches_count",
dropped_batches_count
);
inc_new_counter_debug!("banking_stage-process_packets", count);
inc_new_counter_debug!("banking_stage-process_transactions", new_tx_count);
inc_new_counter_debug!("banking_stage-dropped_batches_count", dropped_batches_count);
*recv_start = Instant::now();

View File

@ -1170,7 +1170,7 @@ impl ClusterInfo {
stakes: &HashMap<Pubkey, u64>,
) -> Vec<SharedBlob> {
let self_id = me.read().unwrap().gossip.id;
inc_new_high_rate_counter_debug!("cluster_info-push_message", 1);
inc_new_counter_debug!("cluster_info-push_message", 1);
let updated: Vec<_> =
me.write()

View File

@ -296,7 +296,7 @@ impl PohRecorder {
pub fn tick(&mut self) {
let now = Instant::now();
let poh_entry = self.poh.lock().unwrap().tick();
inc_new_high_rate_counter_warn!(
inc_new_counter_warn!(
"poh_recorder-tick_lock_contention",
timing::duration_as_ms(&now.elapsed()) as usize
);
@ -306,7 +306,7 @@ impl PohRecorder {
trace!("tick {}", self.tick_height);
if self.start_leader_at_tick.is_none() {
inc_new_high_rate_counter_warn!(
inc_new_counter_warn!(
"poh_recorder-tick_overhead",
timing::duration_as_ms(&now.elapsed()) as usize
);
@ -322,7 +322,7 @@ impl PohRecorder {
self.tick_cache.push((entry, self.tick_height));
let _ = self.flush_cache(true);
}
inc_new_high_rate_counter_warn!(
inc_new_counter_warn!(
"poh_recorder-tick_overhead",
timing::duration_as_ms(&now.elapsed()) as usize
);
@ -350,7 +350,7 @@ impl PohRecorder {
let now = Instant::now();
if let Some(poh_entry) = self.poh.lock().unwrap().record(mixin) {
inc_new_high_rate_counter_warn!(
inc_new_counter_warn!(
"poh_recorder-record_lock_contention",
timing::duration_as_ms(&now.elapsed()) as usize
);

View File

@ -556,7 +556,7 @@ impl ReplayStage {
);
}
}
inc_new_high_rate_counter_info!("replay_stage-replay_transactions", tx_count);
inc_new_counter_info!("replay_stage-replay_transactions", tx_count);
did_complete_bank
}

View File

@ -39,7 +39,7 @@ fn retransmit_blobs(blobs: &[SharedBlob], retransmit: &BlobSender, id: &Pubkey)
}
if !retransmit_queue.is_empty() {
inc_new_high_rate_counter_debug!("streamer-recv_window-retransmit", retransmit_queue.len());
inc_new_counter_debug!("streamer-recv_window-retransmit", retransmit_queue.len());
retransmit.send(retransmit_queue)?;
}
Ok(())
@ -113,7 +113,7 @@ where
blobs.append(&mut blob)
}
let now = Instant::now();
inc_new_high_rate_counter_debug!("streamer-recv_window-recv", blobs.len());
inc_new_counter_debug!("streamer-recv_window-recv", blobs.len());
let blobs: Vec<_> = thread_pool.install(|| {
blobs