Add counter for tx count and limit error messages

This commit is contained in:
Stephen Akridge
2018-07-19 15:38:35 -07:00
committed by sakridge
parent 1e63702c36
commit 313fed375c
2 changed files with 13 additions and 1 deletions

View File

@ -307,13 +307,20 @@ impl Bank {
);
let mut tx_count = 0;
let mut err_count = 0;
for r in &res {
if r.is_ok() {
tx_count += 1;
} else {
info!("tx error: {:?}", r);
if err_count == 0 {
info!("tx error: {:?}", r);
}
err_count += 1;
}
}
if err_count > 0 {
info!("{} errors of {} txs", err_count, err_count + tx_count);
}
self.transaction_count
.fetch_add(tx_count, Ordering::Relaxed);
res

View File

@ -88,6 +88,7 @@ impl BankingStage {
timing::duration_as_ms(&recv_start.elapsed()),
mms.len(),
);
let bank_starting_tx_count = bank.transaction_count();
let count = mms.iter().map(|x| x.1.len()).sum();
let proc_start = Instant::now();
for (msgs, vers) in mms {
@ -125,6 +126,10 @@ impl BankingStage {
(reqs_len as f32) / (total_time_s)
);
inc_new_counter!("banking_stage-process_packets", count);
inc_new_counter!(
"banking_stage-process_transactions",
bank.transaction_count() - bank_starting_tx_count
);
Ok(())
}
}