pub struct WorldTiming {
latency: [ExitLatencyHistogram; 23],
rates: [ExitRateMeter; 23],
total_rate: ExitRateMeter,
}Expand description
Timing aggregate of one virtual machine, split by exit class.
The engine records one sample per hardware exit, in whatever unit the caller uses. Per-class histograms keep the measurement cost independent of the class while still exposing which class dominates. A global rate meter tracks the total exit rate; per-class meters track each class.
Fields§
§latency: [ExitLatencyHistogram; 23]Latency histogram per exit class.
rates: [ExitRateMeter; 23]Rate meter per exit class.
total_rate: ExitRateMeterRate meter across every class.
Implementations§
Source§impl WorldTiming
impl WorldTiming
Sourcepub const fn class_count() -> usize
pub const fn class_count() -> usize
Number of aggregated exit classes.
Sourcepub const fn class_index(class: ExitClass) -> usize
pub const fn class_index(class: ExitClass) -> usize
Sourcepub const fn class_at(index: usize) -> Option<ExitClass>
pub const fn class_at(index: usize) -> Option<ExitClass>
Inverse of class_index, or None if index is
out of range. Useful to walk the aggregates in a report.
Sourcepub fn record_exit(&mut self, exit: ExitReason, sample: u64)
pub fn record_exit(&mut self, exit: ExitReason, sample: u64)
Records one decoded exit with its measured latency.
Convenience wrapper over record that applies the
classification of ExitReason, including the guest-entry-failure
bit.
Sourcepub fn latency(&self, class: ExitClass) -> &ExitLatencyHistogram
pub fn latency(&self, class: ExitClass) -> &ExitLatencyHistogram
Latency histogram of class.
Sourcepub fn rate(&self, class: ExitClass) -> &ExitRateMeter
pub fn rate(&self, class: ExitClass) -> &ExitRateMeter
Rate meter of class.
Sourcepub const fn total_rate(&self) -> &ExitRateMeter
pub const fn total_rate(&self) -> &ExitRateMeter
Rate meter across every class.
Sourcepub fn advance_window(&mut self)
pub fn advance_window(&mut self)
Advances the sliding window of every rate meter.
Callers should call this once per measurement slice, after the slice’s exits have been recorded.
Trait Implementations§
Source§impl Clone for WorldTiming
impl Clone for WorldTiming
Source§impl Debug for WorldTiming
impl Debug for WorldTiming
Source§impl Default for WorldTiming
impl Default for WorldTiming
impl Eq for WorldTiming
Source§impl PartialEq for WorldTiming
impl PartialEq for WorldTiming
impl StructuralPartialEq for WorldTiming
Auto Trait Implementations§
impl Forget for WorldTiming
impl Freeze for WorldTiming
impl Move for WorldTiming
impl RefUnwindSafe for WorldTiming
impl Send for WorldTiming
impl Sync for WorldTiming
impl Unpin for WorldTiming
impl UnsafeUnpin for WorldTiming
impl UnwindSafe for WorldTiming
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
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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> ⓘ
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> ⓘ
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