mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-07 07:17:23 +00:00
Adds base benchmark for do_tick in broker pallet (#1235)
* Adds base benchmark for do_tick * ".git/.scripts/commands/bench/bench.sh" --subcommand=pallet --runtime=dev --target_dir=substrate --pallet=pallet_broker * Update substrate/frame/broker/src/benchmarking.rs Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Update substrate/frame/broker/src/benchmarking.rs * ".git/.scripts/commands/bench/bench.sh" --subcommand=pallet --runtime=dev --target_dir=substrate --pallet=pallet_broker * Addresses review comment --------- Co-authored-by: command-bot <> Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
This commit is contained in:
@@ -36,13 +36,14 @@ impl<T: Config> Pallet<T> {
|
||||
/// - Request revenue information for a previous timeslice
|
||||
/// - Initialize an instantaneous core pool historical revenue record
|
||||
pub(crate) fn do_tick() -> Weight {
|
||||
let mut meter = WeightMeter::new();
|
||||
meter.consume(T::WeightInfo::do_tick_base());
|
||||
|
||||
let (mut status, config) = match (Status::<T>::get(), Configuration::<T>::get()) {
|
||||
(Some(s), Some(c)) => (s, c),
|
||||
_ => return Weight::zero(),
|
||||
_ => return meter.consumed(),
|
||||
};
|
||||
|
||||
let mut meter = WeightMeter::new();
|
||||
|
||||
if Self::process_core_count(&mut status) {
|
||||
meter.consume(T::WeightInfo::process_core_count(status.core_count.into()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user