pub struct OperationStats {
pub successful: usize,
pub failed: usize,
pub total: usize,
}Expand description
Statistics about Service Bus operations including success and failure counts.
Tracks the performance and outcome of Service Bus operations, providing metrics for monitoring and debugging purposes. Used throughout the system to report operation results.
§Examples
use quetty_server::service_bus_manager::OperationStats;
let mut stats = OperationStats::new();
stats.add_success();
stats.add_success();
stats.add_failure();
assert_eq!(stats.successful, 2);
assert_eq!(stats.failed, 1);
assert_eq!(stats.total, 3);
assert_eq!(stats.success_rate(), 2.0 / 3.0);Fields§
§successful: usizeNumber of successful operations
failed: usizeNumber of failed operations
total: usizeTotal number of operations attempted
Implementations§
Source§impl OperationStats
impl OperationStats
pub fn new() -> Self
pub fn add_success(&mut self)
pub fn add_failure(&mut self)
pub fn success_rate(&self) -> f64
Trait Implementations§
Source§impl Clone for OperationStats
impl Clone for OperationStats
Source§fn clone(&self) -> OperationStats
fn clone(&self) -> OperationStats
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 OperationStats
impl Debug for OperationStats
Source§impl Default for OperationStats
impl Default for OperationStats
Source§fn default() -> OperationStats
fn default() -> OperationStats
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for OperationStats
impl RefUnwindSafe for OperationStats
impl Send for OperationStats
impl Sync for OperationStats
impl Unpin for OperationStats
impl UnwindSafe for OperationStats
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