pub struct PerformanceMetrics {
pub execution_time: Duration,
pub memory_stats: MemoryStats,
pub ops_per_second: f64,
pub samples_per_second: f64,
pub cpu_usage_percent: f64,
pub gpu_usage_percent: Option<f64>,
pub custom_metrics: HashMap<String, f64>,
}Expand description
Performance measurement results
Fields§
§execution_time: DurationExecution time statistics
memory_stats: MemoryStatsMemory usage statistics
ops_per_second: f64Operations per second
samples_per_second: f64Throughput in samples per second
cpu_usage_percent: f64CPU usage percentage
gpu_usage_percent: Option<f64>GPU usage percentage (if available)
custom_metrics: HashMap<String, f64>Additional custom metrics
Implementations§
Source§impl PerformanceMetrics
impl PerformanceMetrics
Sourcepub fn new(execution_time: Duration, memory_stats: MemoryStats) -> Self
pub fn new(execution_time: Duration, memory_stats: MemoryStats) -> Self
Create a new PerformanceMetrics with the given execution time and memory statistics; other fields default to zero
Sourcepub fn with_ops_per_second(self, ops_per_second: f64) -> Self
pub fn with_ops_per_second(self, ops_per_second: f64) -> Self
Set the throughput in operations per second
Sourcepub fn with_samples_per_second(self, samples_per_second: f64) -> Self
pub fn with_samples_per_second(self, samples_per_second: f64) -> Self
Set the throughput in training or inference samples per second
Sourcepub fn with_cpu_usage(self, cpu_usage_percent: f64) -> Self
pub fn with_cpu_usage(self, cpu_usage_percent: f64) -> Self
Set the measured CPU utilization percentage
Sourcepub fn with_gpu_usage(self, gpu_usage_percent: f64) -> Self
pub fn with_gpu_usage(self, gpu_usage_percent: f64) -> Self
Set the measured GPU utilization percentage
Sourcepub fn add_custom_metric(&mut self, name: String, value: f64)
pub fn add_custom_metric(&mut self, name: String, value: f64)
Insert an arbitrary named metric into the custom metrics map
Trait Implementations§
Source§impl Clone for PerformanceMetrics
impl Clone for PerformanceMetrics
Source§fn clone(&self) -> PerformanceMetrics
fn clone(&self) -> PerformanceMetrics
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 PerformanceMetrics
impl RefUnwindSafe for PerformanceMetrics
impl Send for PerformanceMetrics
impl Sync for PerformanceMetrics
impl Unpin for PerformanceMetrics
impl UnsafeUnpin for PerformanceMetrics
impl UnwindSafe for PerformanceMetrics
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> 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