mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-17 16:01:04 +00:00
Increase the time limit for the perf-check cmd (#4498)
This commit is contained in:
@@ -23,6 +23,8 @@ use polkadot_performance_test::{
|
|||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|
||||||
pub fn host_perf_check() -> Result<(), PerfCheckError> {
|
pub fn host_perf_check() -> Result<(), PerfCheckError> {
|
||||||
|
let pvf_prepare_time_limit = time_limit_from_baseline(PVF_PREPARE_TIME_LIMIT);
|
||||||
|
let erasure_coding_time_limit = time_limit_from_baseline(ERASURE_CODING_TIME_LIMIT);
|
||||||
let wasm_code =
|
let wasm_code =
|
||||||
polkadot_performance_test::WASM_BINARY.ok_or(PerfCheckError::WasmBinaryMissing)?;
|
polkadot_performance_test::WASM_BINARY.ok_or(PerfCheckError::WasmBinaryMissing)?;
|
||||||
|
|
||||||
@@ -32,19 +34,25 @@ pub fn host_perf_check() -> Result<(), PerfCheckError> {
|
|||||||
|
|
||||||
info!("Running the performance checks...");
|
info!("Running the performance checks...");
|
||||||
|
|
||||||
perf_check("PVF-prepare", PVF_PREPARE_TIME_LIMIT, || measure_pvf_prepare(code.as_ref()))?;
|
perf_check("PVF-prepare", pvf_prepare_time_limit, || measure_pvf_prepare(code.as_ref()))?;
|
||||||
|
|
||||||
perf_check("Erasure-coding", ERASURE_CODING_TIME_LIMIT, || {
|
perf_check("Erasure-coding", erasure_coding_time_limit, || {
|
||||||
measure_erasure_coding(ERASURE_CODING_N_VALIDATORS, code.as_ref())
|
measure_erasure_coding(ERASURE_CODING_N_VALIDATORS, code.as_ref())
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Returns a no-warning threshold for the given time limit.
|
||||||
fn green_threshold(duration: Duration) -> Duration {
|
fn green_threshold(duration: Duration) -> Duration {
|
||||||
duration * 4 / 5
|
duration * 4 / 5
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Returns an extended time limit to be used for the actual check.
|
||||||
|
fn time_limit_from_baseline(duration: Duration) -> Duration {
|
||||||
|
duration * 3 / 2
|
||||||
|
}
|
||||||
|
|
||||||
fn perf_check(
|
fn perf_check(
|
||||||
test_name: &str,
|
test_name: &str,
|
||||||
time_limit: Duration,
|
time_limit: Duration,
|
||||||
|
|||||||
Reference in New Issue
Block a user