Add few more metrics data points (#19624)
* Add slot, count and accumulated-units to per-program-timings for determining transaction cost elements * correct the stats naming; fixes the dirty bit resetting
This commit is contained in:
parent
34c1a9ac85
commit
67fa9945e1
|
@ -41,7 +41,7 @@ impl CostUpdateServiceTiming {
|
||||||
let elapsed_ms = now - self.last_print;
|
let elapsed_ms = now - self.last_print;
|
||||||
if elapsed_ms > 1000 {
|
if elapsed_ms > 1000 {
|
||||||
datapoint_info!(
|
datapoint_info!(
|
||||||
"replay-service-timing-stats",
|
"cost-update-service-stats",
|
||||||
("total_elapsed_us", elapsed_ms * 1000, i64),
|
("total_elapsed_us", elapsed_ms * 1000, i64),
|
||||||
(
|
(
|
||||||
"update_cost_model_count",
|
"update_cost_model_count",
|
||||||
|
@ -101,7 +101,8 @@ impl CostUpdateService {
|
||||||
cost_update_receiver: CostUpdateReceiver,
|
cost_update_receiver: CostUpdateReceiver,
|
||||||
) {
|
) {
|
||||||
let mut cost_update_service_timing = CostUpdateServiceTiming::default();
|
let mut cost_update_service_timing = CostUpdateServiceTiming::default();
|
||||||
let mut dirty = false;
|
let mut dirty: bool;
|
||||||
|
let mut update_count: u64;
|
||||||
let wait_timer = Duration::from_millis(100);
|
let wait_timer = Duration::from_millis(100);
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
|
@ -109,7 +110,8 @@ impl CostUpdateService {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut update_count = 0_u64;
|
dirty = false;
|
||||||
|
update_count = 0_u64;
|
||||||
let mut update_cost_model_time = Measure::start("update_cost_model_time");
|
let mut update_cost_model_time = Measure::start("update_cost_model_time");
|
||||||
for cost_update in cost_update_receiver.try_iter() {
|
for cost_update in cost_update_receiver.try_iter() {
|
||||||
dirty |= Self::update_cost_model(&cost_model, &cost_update);
|
dirty |= Self::update_cost_model(&cost_model, &cost_update);
|
||||||
|
|
|
@ -124,18 +124,34 @@ impl ReplaySlotStats {
|
||||||
.iter()
|
.iter()
|
||||||
.collect();
|
.collect();
|
||||||
per_pubkey_timings.sort_by(|a, b| b.1.accumulated_us.cmp(&a.1.accumulated_us));
|
per_pubkey_timings.sort_by(|a, b| b.1.accumulated_us.cmp(&a.1.accumulated_us));
|
||||||
let total: u64 = per_pubkey_timings.iter().map(|a| a.1.accumulated_us).sum();
|
let (total_us, total_units, total_count) =
|
||||||
|
per_pubkey_timings
|
||||||
|
.iter()
|
||||||
|
.fold((0, 0, 0), |(sum_us, sum_units, sum_count), a| {
|
||||||
|
(
|
||||||
|
sum_us + a.1.accumulated_us,
|
||||||
|
sum_units + a.1.accumulated_units,
|
||||||
|
sum_count + a.1.count,
|
||||||
|
)
|
||||||
|
});
|
||||||
|
|
||||||
for (pubkey, time) in per_pubkey_timings.iter().take(5) {
|
for (pubkey, time) in per_pubkey_timings.iter().take(5) {
|
||||||
datapoint_info!(
|
datapoint_info!(
|
||||||
"per_program_timings",
|
"per_program_timings",
|
||||||
|
("slot", slot as i64, i64),
|
||||||
("pubkey", pubkey.to_string(), String),
|
("pubkey", pubkey.to_string(), String),
|
||||||
("execute_us", time.accumulated_us, i64)
|
("execute_us", time.accumulated_us, i64),
|
||||||
|
("accumulated_units", time.accumulated_units, i64),
|
||||||
|
("count", time.count, i64)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
datapoint_info!(
|
datapoint_info!(
|
||||||
"per_program_timings",
|
"per_program_timings",
|
||||||
|
("slot", slot as i64, i64),
|
||||||
("pubkey", "all", String),
|
("pubkey", "all", String),
|
||||||
("execute_us", total, i64)
|
("execute_us", total_us, i64),
|
||||||
|
("accumulated_units", total_units, i64),
|
||||||
|
("count", total_count, i64)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue