Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Commit

Permalink
Include counters for how long forwarding takes and number of failed b…
Browse files Browse the repository at this point in the history
…atches
  • Loading branch information
ryleung-solana committed Mar 22, 2022
1 parent 6a0ccfd commit e2f566e
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion core/src/banking_stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,21 @@ impl BankingStage {
// in favor of shipping Quic support, which was considered higher-priority
if !packet_vec.is_empty() {
inc_new_counter_info!("banking_stage-forwarded_packets", packet_vec.len());
if let Err(err) = send_wire_transaction_batch(&packet_vec, tpu_forwards) {

let mut measure = Measure::start("banking_stage-forward-us");

let res = send_wire_transaction_batch(&packet_vec, tpu_forwards);

measure.stop();
inc_new_counter_info!(
"banking_stage-forward-us",
measure.as_us() as usize,
1000,
1000
);

if let Err(err) = res {
inc_new_counter_info!("banking_stage-forward_packets-failed-batches", 1);
return (Err(err), 0);
}
}
Expand Down

0 comments on commit e2f566e

Please sign in to comment.