pub struct ExecutionMetrics {
pub packages_total: usize,
pub packages_succeeded: usize,
pub packages_failed: usize,
pub total_duration: Duration,
pub package_durations: HashMap<String, Duration>,
pub cache_hit_rate: f64,
}Expand description
Metrics collected during task execution.
Fields§
§packages_total: usizeTotal number of packages processed.
packages_succeeded: usizeNumber of packages that succeeded.
packages_failed: usizeNumber of packages that failed.
total_duration: DurationTotal execution time.
package_durations: HashMap<String, Duration>Duration per package (package name -> duration).
cache_hit_rate: f64Cache hit rate (0.0 to 1.0).
Implementations§
Source§impl ExecutionMetrics
impl ExecutionMetrics
Sourcepub fn record_package(
&mut self,
package_name: String,
duration: Duration,
success: bool,
)
pub fn record_package( &mut self, package_name: String, duration: Duration, success: bool, )
Records a package execution result.
Sourcepub fn set_total_duration(&mut self, duration: Duration)
pub fn set_total_duration(&mut self, duration: Duration)
Sets the total execution duration.
Sourcepub fn set_cache_hit_rate(&mut self, rate: f64)
pub fn set_cache_hit_rate(&mut self, rate: f64)
Sets the cache hit rate.
Sourcepub fn average_package_duration(&self) -> Duration
pub fn average_package_duration(&self) -> Duration
Returns the average duration per package.
Sourcepub fn success_rate(&self) -> f64
pub fn success_rate(&self) -> f64
Returns the success rate (0.0 to 1.0).
Trait Implementations§
Source§impl Clone for ExecutionMetrics
impl Clone for ExecutionMetrics
Source§fn clone(&self) -> ExecutionMetrics
fn clone(&self) -> ExecutionMetrics
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 moreSource§impl Debug for ExecutionMetrics
impl Debug for ExecutionMetrics
Source§impl Default for ExecutionMetrics
impl Default for ExecutionMetrics
Source§fn default() -> ExecutionMetrics
fn default() -> ExecutionMetrics
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ExecutionMetrics
impl RefUnwindSafe for ExecutionMetrics
impl Send for ExecutionMetrics
impl Sync for ExecutionMetrics
impl Unpin for ExecutionMetrics
impl UnwindSafe for ExecutionMetrics
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> 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