Skip to content

Commit

Permalink
Debug - timing transaction status writes.
Browse files Browse the repository at this point in the history
  • Loading branch information
fkouteib committed Oct 2, 2024
1 parent 83e7d84 commit e4a1cd8
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion rpc/src/transaction_status_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use {
Arc,
},
thread::{self, Builder, JoinHandle},
time::Duration,
time::{Duration, Instant},
},
};

Expand Down Expand Up @@ -73,6 +73,8 @@ impl TransactionStatusService {
token_balances,
transaction_indexes,
}) => {
let start_time = Instant::now();

for (
transaction,
commit_result,
Expand Down Expand Up @@ -181,6 +183,12 @@ impl TransactionStatusService {
.expect("Expect database write to succeed: TransactionStatus");
}
}

let elapsed = start_time.elapsed();
println!(
"write_transaction_status_batch execution time: {} microseconds",
elapsed.as_micros()
);
}
TransactionStatusMessage::Freeze(slot) => {
max_complete_transaction_status_slot.fetch_max(slot, Ordering::SeqCst);
Expand Down

0 comments on commit e4a1cd8

Please sign in to comment.