use std::time::Duration;

pub trait Profile: 'static {
    const RING_ENTRIES: u32;
    const HYBRID_PARK: bool;
    const DEFER_TASKRUN: bool;

    const TASK_BUDGET: Option<usize>;
    const IDLE_PARK: Option<Duration>;

    const ACTIVE_WINDOW: Duration;
    const ACTIVE_PARK_TIMEOUT: Duration;
    const IDLE_PARK_TIMEOUT: Duration;
}

#[derive(Debug)]
pub struct Throughput;

impl Profile for Throughput {
    const RING_ENTRIES: u32 = 4096;
    const HYBRID_PARK: bool = true;
    const DEFER_TASKRUN: bool = true;

    const TASK_BUDGET: Option<usize> = None;
    const IDLE_PARK: Option<Duration> = None;

    const ACTIVE_WINDOW: Duration = Duration::from_millis(2);
    const ACTIVE_PARK_TIMEOUT: Duration = Duration::from_millis(10);
    const IDLE_PARK_TIMEOUT: Duration = Duration::from_millis(50);
}

#[derive(Debug)]
pub struct Tail;

impl Profile for Tail {
    const RING_ENTRIES: u32 = 2048;
    const HYBRID_PARK: bool = false;
    const DEFER_TASKRUN: bool = false;

    const TASK_BUDGET: Option<usize> = Some(64);
    const IDLE_PARK: Option<Duration> = Some(Duration::from_micros(200));

    const ACTIVE_WINDOW: Duration = Duration::from_millis(8);
    const ACTIVE_PARK_TIMEOUT: Duration = Duration::from_micros(250);
    const IDLE_PARK_TIMEOUT: Duration = Duration::from_millis(2);
}
