pub struct TenantStorageMetrics {Show 13 fields
pub tenant_id: TenantId,
pub total_save_operations: u64,
pub total_load_operations: u64,
pub total_events_saved: u64,
pub total_events_loaded: u64,
pub successful_saves: u64,
pub successful_loads: u64,
pub average_save_time_ms: f64,
pub average_load_time_ms: f64,
pub max_save_time_ms: f64,
pub max_load_time_ms: f64,
pub last_operation: Option<DateTime<Utc>>,
pub operations_by_type: HashMap<String, u64>,
}Expand description
Performance and usage metrics for tenant event storage
Fields§
§tenant_id: TenantId§total_save_operations: u64§total_load_operations: u64§total_events_saved: u64§total_events_loaded: u64§successful_saves: u64§successful_loads: u64§average_save_time_ms: f64§average_load_time_ms: f64§max_save_time_ms: f64§max_load_time_ms: f64§last_operation: Option<DateTime<Utc>>§operations_by_type: HashMap<String, u64>Implementations§
Source§impl TenantStorageMetrics
impl TenantStorageMetrics
pub fn new() -> Self
pub fn record_operation( &mut self, operation: TenantOperation, _event_count: u64, )
pub fn record_save_operation(&mut self, duration: Duration, success: bool)
pub fn record_load_operation( &mut self, duration: Duration, success: bool, event_count: usize, )
Sourcepub fn save_success_rate(&self) -> f64
pub fn save_success_rate(&self) -> f64
Calculate success rates
pub fn load_success_rate(&self) -> f64
Sourcepub fn is_performance_target_met(&self) -> bool
pub fn is_performance_target_met(&self) -> bool
Check if performance targets are met
Trait Implementations§
Source§impl Clone for TenantStorageMetrics
impl Clone for TenantStorageMetrics
Source§fn clone(&self) -> TenantStorageMetrics
fn clone(&self) -> TenantStorageMetrics
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 TenantStorageMetrics
impl Debug for TenantStorageMetrics
Auto Trait Implementations§
impl Freeze for TenantStorageMetrics
impl RefUnwindSafe for TenantStorageMetrics
impl Send for TenantStorageMetrics
impl Sync for TenantStorageMetrics
impl Unpin for TenantStorageMetrics
impl UnwindSafe for TenantStorageMetrics
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