pub struct WorkloadPredictor { /* private fields */ }Expand description
Workload predictor using simple ML models
Implementations§
Source§impl WorkloadPredictor
impl WorkloadPredictor
Sourcepub const MIN_SAMPLES: usize = 10
pub const MIN_SAMPLES: usize = 10
Samples required before a prediction is meaningful.
pub fn new() -> Self
pub fn update_metrics(&mut self, metrics: &PerformanceMetrics)
Sourcepub fn sample_count(&self) -> usize
pub fn sample_count(&self) -> usize
Number of utilization samples observed so far.
Sourcepub fn can_predict(&self) -> bool
pub fn can_predict(&self) -> bool
Whether enough history has accumulated for
WorkloadPredictor::predict_workload to answer.
Sourcepub fn predict_workload(&self, horizon: Duration) -> Result<f32>
pub fn predict_workload(&self, horizon: Duration) -> Result<f32>
Predict mean GPU utilization horizon from now.
§Errors
When fewer than WorkloadPredictor::MIN_SAMPLES samples have been
recorded. Earlier revisions returned a hard-coded 0.75 here, which the
auto-scaler then acted on as though it were a measurement.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WorkloadPredictor
impl RefUnwindSafe for WorkloadPredictor
impl Send for WorkloadPredictor
impl Sync for WorkloadPredictor
impl Unpin for WorkloadPredictor
impl UnsafeUnpin for WorkloadPredictor
impl UnwindSafe for WorkloadPredictor
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more