-
Notifications
You must be signed in to change notification settings - Fork 80
feat: add tiered compactor and some metrics test #461
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
579112b
feat: add tiered compactor and some metrics test
123789456ye 87f9869
chore: fmt
123789456ye b2bd5ec
chore: replace rand with fastrand
123789456ye 1309eae
chore: change visibility
123789456ye ef4eaa8
chore: remove redundant parameters
123789456ye 2f40872
Merge remote-tracking branch 'upstream/main' into feat/compactor
123789456ye bea5ed5
refactor: change major_compaction in TieredCompactor to static method
123789456ye File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What are the reasons for ignoring these tests? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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; | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.