Skip to content

Commit

Permalink
[benchmark] Count tx as success only if effects are ok (#19235)
Browse files Browse the repository at this point in the history
This is more of an issue now that we have congestion control mechanisms
in place where transactions can get cancelled after consensus. We also
have not run our benchmark suite routinely to push these more congested
scenarios so we have not run into this issue before,
  • Loading branch information
arun-koshy authored Sep 6, 2024
1 parent 6c732bf commit 5fb5da2
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions crates/sui-benchmark/src/drivers/bench_driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -724,22 +724,29 @@ async fn run_bench_worker(
.latency_squared_s
.with_label_values(&[&payload.to_string()])
.inc_by(square_latency_ms);

metrics_cloned
.num_success
.with_label_values(&[&payload.to_string()])
.inc();
metrics_cloned
.num_in_flight
.with_label_values(&[&payload.to_string()])
.dec();

let num_commands =
transaction.data().transaction_data().kind().num_commands() as u16;
metrics_cloned
.num_success_cmds
.with_label_values(&[&payload.to_string()])
.inc_by(num_commands as u64);

if effects.is_ok() {
metrics_cloned
.num_success
.with_label_values(&[&payload.to_string()])
.inc();
metrics_cloned
.num_success_cmds
.with_label_values(&[&payload.to_string()])
.inc_by(num_commands as u64);
} else {
metrics_cloned
.num_error
.with_label_values(&[&payload.to_string()])
.inc();
}

if let Some(sig_info) = effects.quorum_sig() {
sig_info.authorities(&committee).for_each(|name| {
Expand Down

0 comments on commit 5fb5da2

Please sign in to comment.