Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ log = "0.4.22"
redb = { version = "2", optional = true }
rocksdb = { version = "0.23", optional = true }
sled = { version = "0.34", optional = true }
rand = "0.9.2"

[target.'cfg(target_arch = "wasm32")'.dependencies]
getrandom = { version = "0.3.1", features = ["wasm_js"] }
Expand Down
50 changes: 50 additions & 0 deletions src/compaction/leveled.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1264,3 +1264,53 @@ pub(crate) mod tests {
}
}
}

#[cfg(all(test, feature = "tokio"))]
pub(crate) mod tests_metric {

use fusio::path::Path;
use tempfile::TempDir;

use crate::{
compaction::{
leveled::LeveledOptions,
tests_metric::{read_write_amplification_measurement, throughput},
},
inmem::immutable::tests::TestSchema,
trigger::TriggerType,
DbOption,
};

#[tokio::test(flavor = "multi_thread")]
#[ignore]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are the reasons for ignoring these tests?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since they are not testing functionality but more like bench, to compare between compactors.

async fn read_write_amplification_measurement_leveled() {
let temp_dir = TempDir::new().unwrap();
let leveled_options = LeveledOptions {
major_threshold_with_sst_size: 3,
level_sst_magnification: 4,
..Default::default()
};
let option = DbOption::new(
Path::from_filesystem_path(temp_dir.path()).unwrap(),
&TestSchema,
)
.leveled_compaction(leveled_options)
.max_sst_file_size(1024); // Small file size to force multiple files

read_write_amplification_measurement(option).await;
}

#[tokio::test(flavor = "multi_thread")]
#[ignore]
async fn throughput_leveled() {
let temp_dir = TempDir::new().unwrap();
let mut option = DbOption::new(
Path::from_filesystem_path(temp_dir.path()).unwrap(),
&TestSchema,
)
.leveled_compaction(LeveledOptions::default());
option.trigger_type = TriggerType::SizeOfMem(1 * 1024 * 1024);

throughput(option).await;
}
}
Loading
Loading