Add counter for tx count and limit error messages
This commit is contained in:
committed by
sakridge
parent
1e63702c36
commit
313fed375c
@ -307,13 +307,20 @@ impl Bank {
|
|||||||
);
|
);
|
||||||
|
|
||||||
let mut tx_count = 0;
|
let mut tx_count = 0;
|
||||||
|
let mut err_count = 0;
|
||||||
for r in &res {
|
for r in &res {
|
||||||
if r.is_ok() {
|
if r.is_ok() {
|
||||||
tx_count += 1;
|
tx_count += 1;
|
||||||
} else {
|
} 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
|
self.transaction_count
|
||||||
.fetch_add(tx_count, Ordering::Relaxed);
|
.fetch_add(tx_count, Ordering::Relaxed);
|
||||||
res
|
res
|
||||||
|
@ -88,6 +88,7 @@ impl BankingStage {
|
|||||||
timing::duration_as_ms(&recv_start.elapsed()),
|
timing::duration_as_ms(&recv_start.elapsed()),
|
||||||
mms.len(),
|
mms.len(),
|
||||||
);
|
);
|
||||||
|
let bank_starting_tx_count = bank.transaction_count();
|
||||||
let count = mms.iter().map(|x| x.1.len()).sum();
|
let count = mms.iter().map(|x| x.1.len()).sum();
|
||||||
let proc_start = Instant::now();
|
let proc_start = Instant::now();
|
||||||
for (msgs, vers) in mms {
|
for (msgs, vers) in mms {
|
||||||
@ -125,6 +126,10 @@ impl BankingStage {
|
|||||||
(reqs_len as f32) / (total_time_s)
|
(reqs_len as f32) / (total_time_s)
|
||||||
);
|
);
|
||||||
inc_new_counter!("banking_stage-process_packets", count);
|
inc_new_counter!("banking_stage-process_packets", count);
|
||||||
|
inc_new_counter!(
|
||||||
|
"banking_stage-process_transactions",
|
||||||
|
bank.transaction_count() - bank_starting_tx_count
|
||||||
|
);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user