Skip to content

Commit

Permalink
Report mean,min,max
Browse files Browse the repository at this point in the history
  • Loading branch information
ksolana committed Oct 26, 2024
1 parent 10bebfa commit d19f6be
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 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,7 @@ impl ConsumeWorkerMetrics {
self.timing_metrics
.find_and_send_votes_us
.fetch_add(*find_and_send_votes_us, Ordering::Relaxed);
self.timing_metrics.count.fetch_add(1, Ordering::Relaxed);
}

fn update_on_error_counters(
Expand Down Expand Up @@ -505,12 +512,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,
count: AtomicU64,
}

impl ConsumeWorkerTimingMetrics {
Expand All @@ -533,6 +543,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
),
(
"load_execute_us_mean",
self.load_execute_us.swap(0, Ordering::Relaxed)/self.count.swap(0, Ordering::Relaxed),
i64
),
(
"freeze_lock_us",
self.freeze_lock_us.swap(0, Ordering::Relaxed),
Expand Down

0 comments on commit d19f6be

Please sign in to comment.