common_runtime/weights/
rocksdb_weights.rs

1//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
2//! DATE: 2024-08-22 (Y/M/D)
3//! HOSTNAME: `ip-10-173-4-131`, CPU: `Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz`
4//!
5//! DATABASE: `RocksDb`, RUNTIME: `Frequency`
6//! BLOCK-NUM: `BlockId::Number(4413540)`
7//! SKIP-WRITE: `false`, SKIP-READ: `false`, WARMUPS: `2`
8//! STATE-VERSION: `V1`, STATE-CACHE-SIZE: ``
9//! WEIGHT-PATH: ``
10//! METRIC: `Average`, WEIGHT-MUL: `1.3`, WEIGHT-ADD: `0`
11
12// Executed Command:
13//   ./target/release/frequency
14//   benchmark
15//   storage
16//   --state-version=1
17//   --chain=frequency
18//   --base-path=/data
19//   --include-child-trees
20//   --warmups=2
21//   --mul=1.3
22
23/// Storage DB weights for the `Frequency` runtime and `RocksDb`.
24pub mod constants {
25	use frame_support::weights::constants;
26	use sp_core::parameter_types;
27	use sp_weights::RuntimeDbWeight;
28
29	parameter_types! {
30		/// By default, Substrate uses `RocksDB`, so this will be the weight used throughout
31		/// the runtime.
32		pub const RocksDbWeight: RuntimeDbWeight = RuntimeDbWeight {
33			// Time to read one storage item.
34			// Calculated by multiplying the *Average* of all values with `1.3` and adding `0`.
35			//
36			// Stats nanoseconds:
37			//   Min, Max: 1_676, 3_967_371
38			//   Average:  68_610
39			//   Median:   55_534
40			//   Std-Dev:  104861.07
41			//
42			// Percentiles nanoseconds:
43			//   99th: 743_669
44			//   95th: 82_813
45			//   75th: 62_747
46			read: 89_193 * constants::WEIGHT_REF_TIME_PER_NANOS,
47
48			// Time to write one storage item.
49			// Calculated by multiplying the *Average* of all values with `1.3` and adding `0`.
50			//
51			// Stats nanoseconds:
52			//   Min, Max: 6_945, 27_330_702
53			//   Average:  94_298
54			//   Median:   104_840
55			//   Std-Dev:  89548.06
56			//
57			//   99th: 167_407
58			//   95th: 146_669
59			//   75th: 121_699
60			write: 122_587 * constants::WEIGHT_REF_TIME_PER_NANOS,
61		};
62	}
63
64	#[cfg(test)]
65	mod test_db_weights {
66		use super::constants::RocksDbWeight as W;
67		use sp_weights::constants;
68
69		/// Checks that all weights exist and have sane values.
70		// NOTE: If this test fails but you are sure that the generated values are fine,
71		// you can delete it.
72		#[test]
73		fn bound() {
74			// At least 1 µs.
75			assert!(
76				W::get().reads(1).ref_time() >= constants::WEIGHT_REF_TIME_PER_MICROS,
77				"Read weight should be at least 1 µs."
78			);
79			assert!(
80				W::get().writes(1).ref_time() >= constants::WEIGHT_REF_TIME_PER_MICROS,
81				"Write weight should be at least 1 µs."
82			);
83			// At most 1 ms.
84			assert!(
85				W::get().reads(1).ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS,
86				"Read weight should be at most 1 ms."
87			);
88			assert!(
89				W::get().writes(1).ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS,
90				"Write weight should be at most 1 ms."
91			);
92		}
93	}
94}