use super::{
global_timeout::GlobalTimeout,
slow_timeout::{SlowTimeout, deserialize_slow_timeout},
};
use serde::Deserialize;
#[derive(Clone, Debug)]
pub(in crate::config) struct DefaultBenchConfig {
pub(in crate::config) slow_timeout: SlowTimeout,
pub(in crate::config) global_timeout: GlobalTimeout,
}
impl DefaultBenchConfig {
pub(in crate::config) fn for_default_profile(data: BenchConfig) -> Self {
DefaultBenchConfig {
slow_timeout: data
.slow_timeout
.expect("bench.slow-timeout present in default profile"),
global_timeout: data
.global_timeout
.expect("bench.global-timeout present in default profile"),
}
}
}
#[derive(Clone, Debug, Default, Deserialize)]
#[serde(rename_all = "kebab-case")]
pub(in crate::config) struct BenchConfig {
#[serde(default, deserialize_with = "deserialize_slow_timeout")]
pub(in crate::config) slow_timeout: Option<SlowTimeout>,
#[serde(default)]
pub(in crate::config) global_timeout: Option<GlobalTimeout>,
}