pub struct FieldCountTracker { /* private fields */ }Expand description
In-memory field count tracker
Implementations§
Source§impl FieldCountTracker
impl FieldCountTracker
Sourcepub fn record_count(
&mut self,
workspace_id: Option<&str>,
endpoint: &str,
method: &str,
field_count: u32,
)
pub fn record_count( &mut self, workspace_id: Option<&str>, endpoint: &str, method: &str, field_count: u32, )
Record a field count for an endpoint
Sourcepub fn get_baseline_count(
&self,
workspace_id: Option<&str>,
endpoint: &str,
method: &str,
before: Option<DateTime<Utc>>,
) -> Option<u32>
pub fn get_baseline_count( &self, workspace_id: Option<&str>, endpoint: &str, method: &str, before: Option<DateTime<Utc>>, ) -> Option<u32>
Get the baseline field count for an endpoint
Returns the most recent field count recorded before the specified time, or the most recent count if no time is specified.
Sourcepub fn get_average_count(
&self,
workspace_id: Option<&str>,
endpoint: &str,
method: &str,
window_days: u32,
) -> Option<f64>
pub fn get_average_count( &self, workspace_id: Option<&str>, endpoint: &str, method: &str, window_days: u32, ) -> Option<f64>
Get average field count over a time window
Returns the average field count for records within the specified time window.
Sourcepub fn calculate_churn_percent(
&self,
workspace_id: Option<&str>,
endpoint: &str,
method: &str,
current_count: u32,
window_days: Option<u32>,
) -> Option<f64>
pub fn calculate_churn_percent( &self, workspace_id: Option<&str>, endpoint: &str, method: &str, current_count: u32, window_days: Option<u32>, ) -> Option<f64>
Calculate field churn percentage
Returns the percentage change in field count compared to the baseline. Positive values indicate growth, negative values indicate reduction.
Sourcepub fn cleanup_old_records(&mut self, retention_days: u32)
pub fn cleanup_old_records(&mut self, retention_days: u32)
Clean up old records beyond retention period
Trait Implementations§
Source§impl Clone for FieldCountTracker
impl Clone for FieldCountTracker
Source§fn clone(&self) -> FieldCountTracker
fn clone(&self) -> FieldCountTracker
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 moreSource§impl Debug for FieldCountTracker
impl Debug for FieldCountTracker
Auto Trait Implementations§
impl Freeze for FieldCountTracker
impl RefUnwindSafe for FieldCountTracker
impl Send for FieldCountTracker
impl Sync for FieldCountTracker
impl Unpin for FieldCountTracker
impl UnsafeUnpin for FieldCountTracker
impl UnwindSafe for FieldCountTracker
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