pub struct RateLimitStats {
pub global_usage: u64,
pub global_limit: u64,
pub subject_usage: Vec<(String, u64, u64)>,
}Expand description
Rate limiting statistics.
Fields§
§global_usage: u64Current global usage.
global_limit: u64Global rate limit.
subject_usage: Vec<(String, u64, u64)>Subject-specific usage: (subject_id, current_usage, limit).
Implementations§
Source§impl RateLimitStats
impl RateLimitStats
Sourcepub fn global_usage_percentage(&self) -> f64
pub fn global_usage_percentage(&self) -> f64
Get global usage percentage.
Sourcepub fn subjects_approaching_limit(
&self,
threshold_percentage: f64,
) -> Vec<String>
pub fn subjects_approaching_limit( &self, threshold_percentage: f64, ) -> Vec<String>
Get subjects approaching their rate limit (above threshold percentage).
Trait Implementations§
Source§impl Clone for RateLimitStats
impl Clone for RateLimitStats
Source§fn clone(&self) -> RateLimitStats
fn clone(&self) -> RateLimitStats
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 moreAuto Trait Implementations§
impl Freeze for RateLimitStats
impl RefUnwindSafe for RateLimitStats
impl Send for RateLimitStats
impl Sync for RateLimitStats
impl Unpin for RateLimitStats
impl UnwindSafe for RateLimitStats
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