pub struct HealthPolicy {
pub weight: f64,
pub healthy_score: f64,
pub degraded_score: f64,
}Expand description
Health-based routing policy
Strongly penalizes unhealthy or degraded nodes.
Fields§
§weight: f64Weight for this policy
healthy_score: f64Score for healthy nodes
degraded_score: f64Score for degraded nodes
Trait Implementations§
Source§impl Default for HealthPolicy
impl Default for HealthPolicy
Source§impl RoutingPolicyTrait for HealthPolicy
impl RoutingPolicyTrait for HealthPolicy
Source§fn score(&self, candidate: &RouteCandidate, _request: &InferenceRequest) -> f64
fn score(&self, candidate: &RouteCandidate, _request: &InferenceRequest) -> f64
Score a candidate node (higher = better)
Source§fn is_eligible(
&self,
candidate: &RouteCandidate,
_request: &InferenceRequest,
) -> bool
fn is_eligible( &self, candidate: &RouteCandidate, _request: &InferenceRequest, ) -> bool
Check if a candidate is eligible
Auto Trait Implementations§
impl Freeze for HealthPolicy
impl RefUnwindSafe for HealthPolicy
impl Send for HealthPolicy
impl Sync for HealthPolicy
impl Unpin for HealthPolicy
impl UnwindSafe for HealthPolicy
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
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