pub struct NodePerformance {
pub node_id: NodeId,
pub avg_time_per_cost: f64,
pub time_stddev: f64,
pub chunks_processed: usize,
pub total_time: Duration,
pub failures: usize,
pub success_rate: f64,
pub current_load: usize,
/* private fields */
}Expand description
Performance metrics for a node
Fields§
§node_id: NodeIdNode ID
avg_time_per_cost: f64Average processing time per unit of estimated cost
time_stddev: f64Standard deviation of processing times
chunks_processed: usizeNumber of chunks processed
total_time: DurationTotal processing time
failures: usizeNumber of failures
success_rate: f64Success rate (0.0 to 1.0)
current_load: usizeCurrent load (number of pending chunks)
Implementations§
Source§impl NodePerformance
impl NodePerformance
Sourcepub fn update(
&mut self,
processing_time: Duration,
estimated_cost: f64,
success: bool,
)
pub fn update( &mut self, processing_time: Duration, estimated_cost: f64, success: bool, )
Update performance with a new sample
Sourcepub fn expected_time(&self, estimated_cost: f64) -> Duration
pub fn expected_time(&self, estimated_cost: f64) -> Duration
Get expected processing time for a given cost
Sourcepub fn assignment_score(&self, estimated_cost: f64) -> f64
pub fn assignment_score(&self, estimated_cost: f64) -> f64
Calculate node score for assignment (higher is better)
Trait Implementations§
Source§impl Clone for NodePerformance
impl Clone for NodePerformance
Source§fn clone(&self) -> NodePerformance
fn clone(&self) -> NodePerformance
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for NodePerformance
impl RefUnwindSafe for NodePerformance
impl Send for NodePerformance
impl Sync for NodePerformance
impl Unpin for NodePerformance
impl UnsafeUnpin for NodePerformance
impl UnwindSafe for NodePerformance
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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