mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-03 08:47:23 +00:00
47e46d178b
Introduce a new test objective : `DataAvailabilityWrite`. The new benchmark measures the network and cpu usage of `availability-distribution`, `biftield-distribution` and `availability-store` subsystems from the perspective of a validator node during the process when candidates are made available. Additionally I refactored the networking emulation to support bandwidth acounting and limits of incoming and outgoing requests. Screenshot of succesful run <img width="1293" alt="Screenshot 2024-01-17 at 19 17 44" src="https://github.com/paritytech/polkadot-sdk/assets/54316454/fde11280-e25b-4dc3-9dc9-d4b9752f9b7a"> --------- Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
63 lines
2.1 KiB
Rust
63 lines
2.1 KiB
Rust
// Copyright (C) Parity Technologies (UK) Ltd.
|
|
// This file is part of Polkadot.
|
|
|
|
// Polkadot is free software: you can redistribute it and/or modify
|
|
// it under the terms of the GNU General Public License as published by
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
// (at your option) any later version.
|
|
|
|
// Polkadot is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
// GNU General Public License for more details.
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
|
|
use super::availability::DataAvailabilityReadOptions;
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
#[derive(Debug, Clone, Serialize, Deserialize, clap::Parser)]
|
|
#[clap(rename_all = "kebab-case")]
|
|
#[allow(missing_docs)]
|
|
pub struct TestSequenceOptions {
|
|
#[clap(short, long, ignore_case = true)]
|
|
pub path: String,
|
|
}
|
|
|
|
/// Supported test objectives
|
|
#[derive(Debug, Clone, clap::Parser, Serialize, Deserialize)]
|
|
#[command(rename_all = "kebab-case")]
|
|
pub enum TestObjective {
|
|
/// Benchmark availability recovery strategies.
|
|
DataAvailabilityRead(DataAvailabilityReadOptions),
|
|
/// Benchmark availability and bitfield distribution.
|
|
DataAvailabilityWrite,
|
|
/// Run a test sequence specified in a file
|
|
TestSequence(TestSequenceOptions),
|
|
}
|
|
|
|
#[derive(Debug, clap::Parser)]
|
|
#[clap(rename_all = "kebab-case")]
|
|
#[allow(missing_docs)]
|
|
pub struct StandardTestOptions {
|
|
#[clap(long, ignore_case = true, default_value_t = 100)]
|
|
/// Number of cores to fetch availability for.
|
|
pub n_cores: usize,
|
|
|
|
#[clap(long, ignore_case = true, default_value_t = 500)]
|
|
/// Number of validators to fetch chunks from.
|
|
pub n_validators: usize,
|
|
|
|
#[clap(long, ignore_case = true, default_value_t = 5120)]
|
|
/// The minimum pov size in KiB
|
|
pub min_pov_size: usize,
|
|
|
|
#[clap(long, ignore_case = true, default_value_t = 5120)]
|
|
/// The maximum pov size bytes
|
|
pub max_pov_size: usize,
|
|
|
|
#[clap(short, long, ignore_case = true, default_value_t = 1)]
|
|
/// The number of blocks the test is going to run.
|
|
pub num_blocks: usize,
|
|
}
|