mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-30 16:59:52 +00:00
feat: add scheduler workload admission contracts (#3602)
This commit is contained in:
@@ -239,6 +239,26 @@ mod tests {
|
||||
assert_eq!(core.low_priority_size_threshold, policy.low_priority_threshold);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_scheduler_default_thresholds_remain_stable() {
|
||||
let policy = SchedulerPolicy::default();
|
||||
assert_eq!(policy.base_buffer_size, 64 * 1024);
|
||||
assert_eq!(policy.max_buffer_size, 4 * 1024 * 1024);
|
||||
assert_eq!(policy.high_priority_threshold, 1024 * 1024);
|
||||
assert_eq!(policy.low_priority_threshold, 10 * 1024 * 1024);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_scheduler_priority_boundaries_remain_stable() {
|
||||
let policy = SchedulerPolicy::default();
|
||||
let manager = SchedulerManager::from_policy(policy);
|
||||
|
||||
assert_eq!(manager.get_priority(1_048_575), IoPriority::High);
|
||||
assert_eq!(manager.get_priority(1_048_576), IoPriority::Normal);
|
||||
assert_eq!(manager.get_priority(10_485_760), IoPriority::Normal);
|
||||
assert_eq!(manager.get_priority(10_485_761), IoPriority::Low);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_scheduler_manager() {
|
||||
let manager = SchedulerManager::new(1024, 4096, 512, 2048);
|
||||
|
||||
Reference in New Issue
Block a user