pub struct EventRate {
pub starts: Vec<i64>,
pub counts: Vec<u64>,
pub positive: Vec<u64>,
pub negative: Vec<u64>,
pub bin_us: i64,
}Expand description
Activity over time, binned into fixed-width intervals.
starts holds each bin’s left edge in the stream’s own timestamp units, so it lines up with
EventStream::ts() without conversion. The three count arrays are the same length as starts.
Fields§
§starts: Vec<i64>Left edge of each bin, in stream timestamp units (µs).
counts: Vec<u64>Events of either polarity in each bin.
positive: Vec<u64>Positive-polarity events in each bin.
negative: Vec<u64>Negative-polarity events in each bin.
bin_us: i64Bin width in stream timestamp units (µs).
Implementations§
Source§impl EventRate
impl EventRate
Sourcepub fn per_second(&self) -> Vec<f64>
pub fn per_second(&self) -> Vec<f64>
Events per second in each bin — counts divided by the bin width.
Separate from counts because the bins are uniform: dividing is only meaningful if every bin
covers the same span, which is exactly what this binning guarantees and what a caller
aggregating by some other rule could not assume.
Trait Implementations§
impl Eq for EventRate
impl StructuralPartialEq for EventRate
Auto Trait Implementations§
impl Freeze for EventRate
impl RefUnwindSafe for EventRate
impl Send for EventRate
impl Sync for EventRate
impl Unpin for EventRate
impl UnsafeUnpin for EventRate
impl UnwindSafe for EventRate
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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