Skip to content

Commit

Permalink
Report mean,min,max ConsumeWorkerMetrics::timing_metrics (anza-xyz#3321)
Browse files Browse the repository at this point in the history
* Report mean,min,max
* Directly send the commit_count instead of computing the mean
* Rename commit_count to num_batches_processed
  • Loading branch information
ksolana authored Nov 4, 2024
1 parent faf5c73 commit afd766a
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions core/src/banking_stage/consume_worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,12 @@ impl ConsumeWorkerMetrics {
self.timing_metrics
.collect_balances_us
.fetch_add(*collect_balances_us, Ordering::Relaxed);
self.timing_metrics
.load_execute_us_min
.fetch_min(*load_execute_us, Ordering::Relaxed);
self.timing_metrics
.load_execute_us_max
.fetch_max(*load_execute_us, Ordering::Relaxed);
self.timing_metrics
.load_execute_us
.fetch_add(*load_execute_us, Ordering::Relaxed);
Expand All @@ -310,6 +316,9 @@ impl ConsumeWorkerMetrics {
self.timing_metrics
.find_and_send_votes_us
.fetch_add(*find_and_send_votes_us, Ordering::Relaxed);
self.timing_metrics
.num_batches_processed
.fetch_add(1, Ordering::Relaxed);
}

fn update_on_error_counters(
Expand Down Expand Up @@ -505,12 +514,15 @@ struct ConsumeWorkerTimingMetrics {
cost_model_us: AtomicU64,
collect_balances_us: AtomicU64,
load_execute_us: AtomicU64,
load_execute_us_min: AtomicU64,
load_execute_us_max: AtomicU64,
freeze_lock_us: AtomicU64,
record_us: AtomicU64,
commit_us: AtomicU64,
find_and_send_votes_us: AtomicU64,
wait_for_bank_success_us: AtomicU64,
wait_for_bank_failure_us: AtomicU64,
num_batches_processed: AtomicU64,
}

impl ConsumeWorkerTimingMetrics {
Expand All @@ -533,6 +545,21 @@ impl ConsumeWorkerTimingMetrics {
self.load_execute_us.swap(0, Ordering::Relaxed),
i64
),
(
"load_execute_us_min",
self.load_execute_us_min.swap(0, Ordering::Relaxed),
i64
),
(
"load_execute_us_max",
self.load_execute_us_max.swap(0, Ordering::Relaxed),
i64
),
(
"num_batches_processed",
self.num_batches_processed.swap(0, Ordering::Relaxed),
i64
),
(
"freeze_lock_us",
self.freeze_lock_us.swap(0, Ordering::Relaxed),
Expand Down

0 comments on commit afd766a

Please sign in to comment.