pub struct HeatMap {
pub buckets: usize,
pub span_ns: u64,
pub counts: Vec<u64>,
}Expand description
A heat map showing call density over time.
Fields§
§buckets: usizeNumber of time buckets.
span_ns: u64Total time span covered in nanoseconds.
counts: Vec<u64>Counts per bucket.
Implementations§
Source§impl HeatMap
impl HeatMap
Sourcepub fn new(buckets: usize, span_ns: u64) -> Self
pub fn new(buckets: usize, span_ns: u64) -> Self
Create a heat map with buckets time slots covering span_ns.
Sourcepub fn record(&mut self, timestamp_ns: u64, start_ns: u64)
pub fn record(&mut self, timestamp_ns: u64, start_ns: u64)
Record an event at the given timestamp.
Sourcepub fn peak_bucket(&self) -> usize
pub fn peak_bucket(&self) -> usize
Return the bucket with the maximum count.
Sourcepub fn render_ascii(&self) -> String
pub fn render_ascii(&self) -> String
Format as ASCII art.
Auto Trait Implementations§
impl Freeze for HeatMap
impl RefUnwindSafe for HeatMap
impl Send for HeatMap
impl Sync for HeatMap
impl Unpin for HeatMap
impl UnsafeUnpin for HeatMap
impl UnwindSafe for HeatMap
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