Add perf counters for record/write stages (#1240)
This commit is contained in:
parent
7ac9d6c604
commit
072b244575
|
@ -5,10 +5,13 @@
|
||||||
//! Transaction, the latest hash, and the number of hashes since the last transaction.
|
//! Transaction, the latest hash, and the number of hashes since the last transaction.
|
||||||
//! The resulting stream of entries represents ordered transactions in time.
|
//! The resulting stream of entries represents ordered transactions in time.
|
||||||
|
|
||||||
|
use counter::Counter;
|
||||||
use entry::Entry;
|
use entry::Entry;
|
||||||
use hash::Hash;
|
use hash::Hash;
|
||||||
|
use log::Level;
|
||||||
use recorder::Recorder;
|
use recorder::Recorder;
|
||||||
use service::Service;
|
use service::Service;
|
||||||
|
use std::sync::atomic::AtomicUsize;
|
||||||
use std::sync::mpsc::{channel, Receiver, RecvError, Sender, TryRecvError};
|
use std::sync::mpsc::{channel, Receiver, RecvError, Sender, TryRecvError};
|
||||||
use std::thread::{self, Builder, JoinHandle};
|
use std::thread::{self, Builder, JoinHandle};
|
||||||
use std::time::{Duration, Instant};
|
use std::time::{Duration, Instant};
|
||||||
|
@ -86,8 +89,14 @@ impl RecordStage {
|
||||||
} else {
|
} else {
|
||||||
vec![]
|
vec![]
|
||||||
};
|
};
|
||||||
|
let txs_len = txs.len();
|
||||||
let entries = recorder.record(txs);
|
let entries = recorder.record(txs);
|
||||||
|
let entries_len = entries.len();
|
||||||
sender.send(entries).or(Err(()))?;
|
sender.send(entries).or(Err(()))?;
|
||||||
|
|
||||||
|
inc_new_counter_info!("record_stage-txs", txs_len);
|
||||||
|
inc_new_counter_info!("record_stage-entries", entries_len);
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,6 +49,8 @@ impl WriteStage {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inc_new_counter_info!("write_stage-write_entries", entries.len());
|
||||||
|
|
||||||
//TODO(anatoly): real stake based voting needs to change this
|
//TODO(anatoly): real stake based voting needs to change this
|
||||||
//leader simply votes if the current set of validators have voted
|
//leader simply votes if the current set of validators have voted
|
||||||
//on a valid last id
|
//on a valid last id
|
||||||
|
|
Loading…
Reference in New Issue