pub struct RateLimitStats {
pub total_requests: u64,
pub allowed: u64,
pub queued: u64,
pub throttled: u64,
pub warned: u64,
pub denied: u64,
pub avg_decision_time_us: u64,
pub p50_decision_time_us: u64,
pub p99_decision_time_us: u64,
pub key_stats: HashMap<String, KeyStatsSnapshot>,
pub uptime_secs: u64,
}Expand description
Overall rate limit statistics snapshot
Fields§
§total_requests: u64Total requests checked
allowed: u64Requests allowed
queued: u64Requests queued
throttled: u64Requests throttled
warned: u64Requests warned
denied: u64Requests denied
avg_decision_time_us: u64Average decision time (microseconds)
p50_decision_time_us: u64P50 decision time (microseconds)
p99_decision_time_us: u64P99 decision time (microseconds)
key_stats: HashMap<String, KeyStatsSnapshot>Per-key statistics
uptime_secs: u64Uptime in seconds
Implementations§
Source§impl RateLimitStats
impl RateLimitStats
Sourcepub fn denial_rate(&self) -> f64
pub fn denial_rate(&self) -> f64
Get overall denial rate
Sourcepub fn allow_rate(&self) -> f64
pub fn allow_rate(&self) -> f64
Get overall allow rate
Sourcepub fn requests_per_second(&self) -> f64
pub fn requests_per_second(&self) -> f64
Get requests per second
Sourcepub fn top_denied_keys(&self, n: usize) -> Vec<(&String, &KeyStatsSnapshot)>
pub fn top_denied_keys(&self, n: usize) -> Vec<(&String, &KeyStatsSnapshot)>
Get keys with highest denial rate
Sourcepub fn top_request_keys(&self, n: usize) -> Vec<(&String, &KeyStatsSnapshot)>
pub fn top_request_keys(&self, n: usize) -> Vec<(&String, &KeyStatsSnapshot)>
Get keys with most requests
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 UnsafeUnpin 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
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