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:  36_369
39			//   Median:   36_876
40			//   Std-Dev:  10368.83
41			//
42			// Percentiles nanoseconds:
43			//   99th: 60_542
44			//   95th: 52_621
45			//   75th: 43_407
46			read: 47_280 * 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: 4_954, 87_545_132
53			//   Average:  57_212
54			//   Median:   62_141
55			//   Std-Dev:  60272.19
56			//
57			// Percentiles nanoseconds:
58			//   99th: 101_820
59			//   95th: 90_948
60			//   75th: 75_800
61			write: 74_376 * constants::WEIGHT_REF_TIME_PER_NANOS,
62		};
63	}
64
65	#[cfg(test)]
66	mod test_db_weights {
67		use super::constants::RocksDbWeight as W;
68		use sp_weights::constants;
69
70		/// Checks that all weights exist and have sane values.
71		// NOTE: If this test fails but you are sure that the generated values are fine,
72		// you can delete it.
73		#[test]
74		fn bound() {
75			// At least 1 µs.
76			assert!(
77				W::get().reads(1).ref_time() >= constants::WEIGHT_REF_TIME_PER_MICROS,
78				"Read weight should be at least 1 µs."
79			);
80			assert!(
81				W::get().writes(1).ref_time() >= constants::WEIGHT_REF_TIME_PER_MICROS,
82				"Write weight should be at least 1 µs."
83			);
84			// At most 1 ms.
85			assert!(
86				W::get().reads(1).ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS,
87				"Read weight should be at most 1 ms."
88			);
89			assert!(
90				W::get().writes(1).ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS,
91				"Write weight should be at most 1 ms."
92			);
93		}
94	}
95}