FAZ 1 Complete: Workspace compile fixes, warning cleanup, version bumps
- Fixed is_using_frame_crate() macro to check for pezframe/pezkuwi_sdk - Removed disable_pezframe_system_supertrait_check temporary bypasses - Feature-gated storage-benchmark and teyrchain-benchmarks code - Fixed dead_code warnings with underscore prefix (_Header) - Removed unused imports and shadowing use statements - Version bumps: procedural-tools 10.0.1, benchmarking-cli 32.0.1, docs 0.0.2, minimal-runtime 0.0.1, yet-another-teyrchain 0.6.1, umbrella 0.1.2 - Updated MAINNET_ROADMAP.md with FAZ 1 completion status
This commit is contained in:
@@ -22,12 +22,14 @@ pub mod record;
|
||||
pub mod stats;
|
||||
pub mod weight_params;
|
||||
|
||||
#[cfg(feature = "storage-benchmark")]
|
||||
pub use record::BenchRecord;
|
||||
pub use stats::{StatSelect, Stats};
|
||||
pub use weight_params::WeightParams;
|
||||
|
||||
use clap::Args;
|
||||
use pezsc_sysinfo::gather_sysinfo;
|
||||
#[cfg(feature = "storage-benchmark")]
|
||||
use rand::prelude::*;
|
||||
use serde::Serialize;
|
||||
|
||||
@@ -73,6 +75,7 @@ where
|
||||
/// Returns an rng and the seed that was used to create it.
|
||||
///
|
||||
/// Uses a random seed if none is provided.
|
||||
#[cfg(feature = "storage-benchmark")]
|
||||
pub fn new_rng(seed: Option<u64>) -> (impl rand::Rng, u64) {
|
||||
let seed = seed.unwrap_or(rand::thread_rng().gen::<u64>());
|
||||
(rand_pcg::Pcg64::seed_from_u64(seed), seed)
|
||||
|
||||
@@ -17,13 +17,18 @@
|
||||
|
||||
//! Defines the [`BenchRecord`] and its facilities for computing [`super::Stats`].
|
||||
|
||||
#[cfg(feature = "storage-benchmark")]
|
||||
use pezsc_cli::Result;
|
||||
#[cfg(feature = "storage-benchmark")]
|
||||
use pezsc_service::Configuration;
|
||||
|
||||
#[cfg(feature = "storage-benchmark")]
|
||||
use log::info;
|
||||
use serde::Serialize;
|
||||
#[cfg(feature = "storage-benchmark")]
|
||||
use std::{fs, path::PathBuf, time::Duration};
|
||||
|
||||
#[cfg(feature = "storage-benchmark")]
|
||||
use super::Stats;
|
||||
|
||||
/// Raw output of a Storage benchmark.
|
||||
@@ -35,6 +40,7 @@ pub struct BenchRecord {
|
||||
|
||||
impl BenchRecord {
|
||||
/// Appends a new record. Uses safe casts.
|
||||
#[cfg(feature = "storage-benchmark")]
|
||||
pub fn append(&mut self, size: usize, d: Duration) -> Result<()> {
|
||||
let size: u64 = size.try_into().map_err(|e| format!("Size overflow u64: {}", e))?;
|
||||
let ns: u64 = d
|
||||
@@ -46,6 +52,7 @@ impl BenchRecord {
|
||||
}
|
||||
|
||||
/// Returns the statistics for *time* and *value size*.
|
||||
#[cfg(feature = "storage-benchmark")]
|
||||
pub fn calculate_stats(self) -> Result<(Stats, Stats)> {
|
||||
let (size, time): (Vec<_>, Vec<_>) = self.ns_per_size.into_iter().unzip();
|
||||
let size = Stats::new(&size)?;
|
||||
@@ -55,6 +62,7 @@ impl BenchRecord {
|
||||
|
||||
/// Unless a path is specified, saves the raw results in a json file in the current directory.
|
||||
/// Prefixes it with the DB name and suffixed with `path_suffix`.
|
||||
#[cfg(feature = "storage-benchmark")]
|
||||
pub fn save_json(&self, cfg: &Configuration, out_path: &PathBuf, suffix: &str) -> Result<()> {
|
||||
let mut path = PathBuf::from(out_path);
|
||||
if path.is_dir() || path.as_os_str().is_empty() {
|
||||
|
||||
Reference in New Issue
Block a user