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.
Sourcepub fn mark(&mut self, run: &Ran, profile: &str, cap: u64, at: u64)
pub fn mark(&mut self, run: &Ran, profile: &str, cap: u64, at: u64)
Learns only how a run of profile ended, not its peak, as for a cancelled one: a run that met its cap
(Ran::met_cap) makes its job in that profile unpredictable for UNPREDICTABLE_FOR, a peak past what it
reserved makes it reserve its largest peak for as long.