pub struct Histogram { /* private fields */ }Expand description
Histogram for tracking value distributions.
Uses power-of-two bucket boundaries for efficient indexing. Bucket boundaries: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, inf
§Example
ⓘ
use reovim_kernel::debug::Histogram;
static RESPONSE_TIMES: Histogram = Histogram::new();
fn handle_request() {
let start = std::time::Instant::now();
// ... handle request ...
RESPONSE_TIMES.record(start.elapsed().as_micros() as u64);
}Implementations§
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Histogram
impl RefUnwindSafe for Histogram
impl Send for Histogram
impl Sync for Histogram
impl Unpin for Histogram
impl UnsafeUnpin for Histogram
impl UnwindSafe for Histogram
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