pub struct EtaTracker { /* private fields */ }Expand description
Tracks processing durations bucketed by (resource, operation, size) to provide increasingly accurate ETA estimates.
Implementations§
Source§impl EtaTracker
impl EtaTracker
pub fn new() -> Self
Sourcepub fn record(
&self,
resource_key: &str,
operation: &str,
size_bucket: SizeBucket,
duration_ms: u64,
)
pub fn record( &self, resource_key: &str, operation: &str, size_bucket: SizeBucket, duration_ms: u64, )
Record a completed item’s duration for future ETA estimates.
Sourcepub fn estimate_one(
&self,
resource_key: &str,
operation: &str,
size_bucket: SizeBucket,
) -> Option<u64>
pub fn estimate_one( &self, resource_key: &str, operation: &str, size_bucket: SizeBucket, ) -> Option<u64>
Estimate processing time for a single item based on historical data.
Returns None if no data is available for this combination.
Sourcepub fn estimate_remaining(
&self,
resource_key: &str,
operation: &str,
remaining_buckets: &[SizeBucket],
) -> Option<u64>
pub fn estimate_remaining( &self, resource_key: &str, operation: &str, remaining_buckets: &[SizeBucket], ) -> Option<u64>
Estimate total remaining time for a set of items.
Sourcepub fn estimate(
&self,
resource_key: &str,
operation: &str,
remaining_buckets: &[SizeBucket],
) -> Option<EtaEstimate>
pub fn estimate( &self, resource_key: &str, operation: &str, remaining_buckets: &[SizeBucket], ) -> Option<EtaEstimate>
Estimate remaining time with structured confidence and sample counts.
Sourcepub fn sample_count(
&self,
resource_key: &str,
operation: &str,
size_bucket: SizeBucket,
) -> u64
pub fn sample_count( &self, resource_key: &str, operation: &str, size_bucket: SizeBucket, ) -> u64
Get the number of data points recorded for a specific key.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for EtaTracker
impl RefUnwindSafe for EtaTracker
impl Send for EtaTracker
impl Sync for EtaTracker
impl Unpin for EtaTracker
impl UnsafeUnpin for EtaTracker
impl UnwindSafe for EtaTracker
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