pub struct ErrorHistogram {
pub buckets: HashMap<String, u64>,
pub total: u64,
}Expand description
Bucketed error counts grouped by error category.
Fields§
§buckets: HashMap<String, u64>Map from error category string to count.
total: u64Total errors across all categories.
Implementations§
Source§impl ErrorHistogram
impl ErrorHistogram
Sourcepub fn top_category(&self) -> Option<(&str, u64)>
pub fn top_category(&self) -> Option<(&str, u64)>
Return the most common error category, if any.
Sourcepub fn sorted_entries(&self) -> Vec<(&str, u64)>
pub fn sorted_entries(&self) -> Vec<(&str, u64)>
Return sorted entries from most to least frequent.
Trait Implementations§
Source§impl Clone for ErrorHistogram
impl Clone for ErrorHistogram
Source§fn clone(&self) -> ErrorHistogram
fn clone(&self) -> ErrorHistogram
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 ErrorHistogram
impl Debug for ErrorHistogram
Source§impl Default for ErrorHistogram
impl Default for ErrorHistogram
Source§fn default() -> ErrorHistogram
fn default() -> ErrorHistogram
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ErrorHistogram
impl<'de> Deserialize<'de> for ErrorHistogram
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ErrorHistogram
impl RefUnwindSafe for ErrorHistogram
impl Send for ErrorHistogram
impl Sync for ErrorHistogram
impl Unpin for ErrorHistogram
impl UnsafeUnpin for ErrorHistogram
impl UnwindSafe for ErrorHistogram
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