Struct slottle::ThrottleLog [−][src]
Collect operation log of a Throttle
.
User can access this log by ThrottleBuilder::interval()
API by
Interval
.
ThrottleLog
will drop oldest log records automatically when it reach
it size limit.
Implementations
impl ThrottleLog
[src]
pub fn size(&self) -> usize
[src]
Get maximum log size.
This value would never change.
pub fn failure_count(&self) -> usize
[src]
Get how many failures exists in log.
Example
(Left is new, right is old, F = Failure, S = Successful)
FFFFF
: 5FFSFF
: 4SFFFF
: 4FSSSS
: 1
pub fn failure_count_cont(&self) -> usize
[src]
Get how many failures from newest log entry continuously.
Example
(Left is new, right is old, F = Failure, S = Successful)
FFFFF
: 5FFSFF
: 2SFFFF
: 0FSSSS
: 1
pub fn failure_rate(&self) -> Option<f64>
[src]
Get failure rate in whole log.
Example
(Left is new, right is old, F = Failure, S = Successful)
FFFFF
: 1.0FFSFF
: 0.8SFFFF
: 0.8FSSSS
: 0.2
This function use size
as denominator. Return None
if size == 0
.
pub fn duration(&self) -> Option<Duration>
[src]
Get duration between first and last log record.
Return None
if don’t have at least 2 log records.
Trait Implementations
impl Clone for ThrottleLog
[src]
fn clone(&self) -> ThrottleLog
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for ThrottleLog
[src]
impl Eq for ThrottleLog
[src]
impl Hash for ThrottleLog
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<ThrottleLog> for ThrottleLog
[src]
fn eq(&self, other: &ThrottleLog) -> bool
[src]
fn ne(&self, other: &ThrottleLog) -> bool
[src]
impl StructuralEq for ThrottleLog
[src]
impl StructuralPartialEq for ThrottleLog
[src]
Auto Trait Implementations
impl RefUnwindSafe for ThrottleLog
impl Send for ThrottleLog
impl Sync for ThrottleLog
impl Unpin for ThrottleLog
impl UnwindSafe for ThrottleLog
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,