pub struct Predictor { /* private fields */ }Expand description
Predicts a job’s peak from the runs it learned.
Implementations§
Source§impl Predictor
impl Predictor
Sourcepub fn new(rules: &Sizing) -> Predictor
pub fn new(rules: &Sizing) -> Predictor
A predictor that knows no run yet, with [sizing]’s margin and minimum runs.
Sourcepub fn learn(&mut self, run: &Ran, profile: &str, cap: u64, at: u64)
pub fn learn(&mut self, run: &Ran, profile: &str, cap: u64, at: u64)
Learns a run of profile that finished at at (ms), having run under cap: its peak, and how it ended.
Sourcepub fn learn_cpu(&mut self, run: &Ran, profile: &str)
pub fn learn_cpu(&mut self, run: &Ran, profile: &str)
Learns the CPU a finished run of profile used, without its peak: as learn does, and alone for a run whose
peak says nothing of its memory, as one sampled with page cache counted.
Sourcepub fn predict_cpu(&self, key: &Key, profile: &str, cap: u64) -> CpuPrediction
pub fn predict_cpu(&self, key: &Key, profile: &str, cap: u64) -> CpuPrediction
The CPU to reserve for a run of key in profile, whose cpus are cap millicores: the job’s average
CPU (its CPU time over its run time), by the same fallbacks as memory without the margin. CPU is shared, not
a kill limit, so neither a run at its cap nor copies of the job beside it change it.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Predictor
impl RefUnwindSafe for Predictor
impl Send for Predictor
impl Sync for Predictor
impl Unpin for Predictor
impl UnsafeUnpin for Predictor
impl UnwindSafe for Predictor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more