pub struct Metrics {
pub throughput: u64,
pub latency: u64,
pub memory_usage: u64,
pub lock_wait_time: u64,
pub timestamp: u64,
pub label: Option<String>,
}Expand description
Performance metrics snapshot
Fields§
§throughput: u64Throughput in bytes per second
latency: u64Latency in milliseconds
memory_usage: u64Memory usage in bytes
lock_wait_time: u64Lock wait time in milliseconds
timestamp: u64Timestamp when metrics were recorded (epoch millis)
label: Option<String>Optional label for the metric
Implementations§
Source§impl Metrics
impl Metrics
Sourcepub fn new(
throughput: u64,
latency: u64,
memory_usage: u64,
lock_wait_time: u64,
) -> Self
pub fn new( throughput: u64, latency: u64, memory_usage: u64, lock_wait_time: u64, ) -> Self
Create a new metrics snapshot
Sourcepub fn with_label(self, label: impl Into<String>) -> Self
pub fn with_label(self, label: impl Into<String>) -> Self
Create metrics with a label
Sourcepub fn performance_score(&self) -> f64
pub fn performance_score(&self) -> f64
Calculate the overall performance score (0-100)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Metrics
impl<'de> Deserialize<'de> for Metrics
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Metrics
impl RefUnwindSafe for Metrics
impl Send for Metrics
impl Sync for Metrics
impl Unpin for Metrics
impl UnsafeUnpin for Metrics
impl UnwindSafe for Metrics
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