add profiles together

This commit is contained in:
pedrocarlo
2025-08-26 16:13:52 -03:00
parent 918c2a3f69
commit ef16bc4cfb
3 changed files with 41 additions and 14 deletions

View File

@@ -1,7 +1,7 @@
#[derive(Debug, Clone)]
pub struct IOProfile {
enable: bool,
latency: LatencyProfile,
pub enable: bool,
pub latency: LatencyProfile,
}
impl Default for IOProfile {
@@ -15,13 +15,13 @@ impl Default for IOProfile {
#[derive(Debug, Clone)]
pub struct LatencyProfile {
enable: bool,
pub enable: bool,
/// Added IO latency probability
latency_probability: usize,
pub latency_probability: usize,
/// Minimum tick time in microseconds for simulated time
min_tick: u64,
pub min_tick: u64,
/// Maximum tick time in microseconds for simulated time
max_tick: u64,
pub max_tick: u64,
}
impl Default for LatencyProfile {

View File

@@ -1,5 +1,22 @@
use crate::profiles::{io::IOProfile, query::QueryProfile};
mod io;
mod query;
#[derive(Debug, Default, Clone)]
pub struct Profile {}
#[derive(Debug, Clone)]
pub struct Profile {
/// Experimental MVCC feature
pub experimental_mvcc: bool,
pub io: IOProfile,
pub query: QueryProfile,
}
impl Default for Profile {
fn default() -> Self {
Self {
experimental_mvcc: false,
io: Default::default(),
query: Default::default(),
}
}
}

View File

@@ -1,6 +1,16 @@
#[derive(Debug, Default, Clone)]
pub struct QueryProfile {
pub create_table: CreateTableProfile,
pub create_index: CreateIndexProfile,
pub insert: InsertProfile,
pub update: UpdateProfile,
pub delete: DeleteProfile,
pub drop_table: DropTableProfile,
}
#[derive(Debug, Clone)]
pub struct CreateTableProfile {
enable: bool,
pub enable: bool,
}
impl Default for CreateTableProfile {
@@ -11,7 +21,7 @@ impl Default for CreateTableProfile {
#[derive(Debug, Clone)]
pub struct CreateIndexProfile {
enable: bool,
pub enable: bool,
}
impl Default for CreateIndexProfile {
@@ -22,7 +32,7 @@ impl Default for CreateIndexProfile {
#[derive(Debug, Clone)]
pub struct InsertProfile {
enable: bool,
pub enable: bool,
}
impl Default for InsertProfile {
@@ -33,7 +43,7 @@ impl Default for InsertProfile {
#[derive(Debug, Clone)]
pub struct UpdateProfile {
enable: bool,
pub enable: bool,
}
impl Default for UpdateProfile {
@@ -44,7 +54,7 @@ impl Default for UpdateProfile {
#[derive(Debug, Clone)]
pub struct DeleteProfile {
enable: bool,
pub enable: bool,
}
impl Default for DeleteProfile {
@@ -55,7 +65,7 @@ impl Default for DeleteProfile {
#[derive(Debug, Clone)]
pub struct DropTableProfile {
enable: bool,
pub enable: bool,
}
impl Default for DropTableProfile {