pub struct StageTimings { /* private fields */ }Expand description
Named synchronized GPU stage samples collected by a benchmark.
Implementations§
Source§impl StageTimings
impl StageTimings
Sourcepub fn measure<T>(
&mut self,
stream: &mut Stream,
name: impl Into<String>,
stage: impl FnOnce(&mut Stream) -> Result<T>,
) -> Result<T>
pub fn measure<T>( &mut self, stream: &mut Stream, name: impl Into<String>, stage: impl FnOnce(&mut Stream) -> Result<T>, ) -> Result<T>
Synchronize, run one stage, synchronize again, and record elapsed milliseconds.
Sourcepub fn push(&mut self, name: impl Into<String>, milliseconds: f64) -> Result<()>
pub fn push(&mut self, name: impl Into<String>, milliseconds: f64) -> Result<()>
Add an already measured nonnegative millisecond sample.
Sourcepub fn distributions(&self) -> Result<BTreeMap<String, Distribution>>
pub fn distributions(&self) -> Result<BTreeMap<String, Distribution>>
Summarize each named stage in lexical order.
Sourcepub fn totals_ms(&self) -> BTreeMap<String, f64>
pub fn totals_ms(&self) -> BTreeMap<String, f64>
Sum the samples for every stage, in milliseconds.
Sourcepub fn take_totals_ms(&mut self) -> BTreeMap<String, f64>
pub fn take_totals_ms(&mut self) -> BTreeMap<String, f64>
Drain the samples and return each stage’s total milliseconds.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StageTimings
impl RefUnwindSafe for StageTimings
impl Send for StageTimings
impl Sync for StageTimings
impl Unpin for StageTimings
impl UnsafeUnpin for StageTimings
impl UnwindSafe for StageTimings
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
Source§impl<T> DropFlavorWrapper<T> for T
impl<T> DropFlavorWrapper<T> for T
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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