pub struct FrameProfile {
pub render: RenderStats,
/* private fields */
}Expand description
Timing collected for one frame and read back by the profiler overlay.
The system timings are double-buffered: a frame accumulates into
current, and begin_frame rotates the just-finished frame into last
so a reader always sees a complete frame rather than a partial one.
Fields§
§render: RenderStatsRender-backend stats for the most recent drawn frame. Left at the default when no graphics backend is running.
Implementations§
Source§impl FrameProfile
impl FrameProfile
Sourcepub fn begin_frame(&mut self)
pub fn begin_frame(&mut self)
Rotate the system-timing buffers at the start of a frame: the frame that just finished becomes the readable snapshot and the accumulator is cleared for the new frame.
Sourcepub fn record_system(&mut self, name: &'static str, micros: u32)
pub fn record_system(&mut self, name: &'static str, micros: u32)
Record one system’s CPU step time for the in-progress frame.
Sourcepub fn record_system_allocs(&mut self, name: &'static str, allocs: u32)
pub fn record_system_allocs(&mut self, name: &'static str, allocs: u32)
Record the heap allocations counted during one system’s step.
Sourcepub fn set_frame_allocs(&mut self, allocs: u32)
pub fn set_frame_allocs(&mut self, allocs: u32)
Record the heap allocations counted across the frame that just finished. Written at the end of a step rather than rotated: the value is complete the moment the frame is, so readers between steps see the latest frame.
Sourcepub fn system_timings(&self) -> &[(&'static str, u32)]
pub fn system_timings(&self) -> &[(&'static str, u32)]
System step times from the last fully completed frame, in step order.
Read by the runtime debug server’s profile command (a binary-only
module), so the lib build sees no caller.
Sourcepub fn system_allocs(&self) -> &[(&'static str, u32)]
pub fn system_allocs(&self) -> &[(&'static str, u32)]
Per-system heap-allocation counts from the last fully completed frame, in step order. Empty unless the frame loop sampled them (dev builds with the tracking allocator installed).
Sourcepub fn frame_allocs(&self) -> Option<u32>
pub fn frame_allocs(&self) -> Option<u32>
Heap allocations counted across the most recent frame, under the same
conditions as system_allocs.
Trait Implementations§
Source§impl Debug for FrameProfile
impl Debug for FrameProfile
Source§impl Default for FrameProfile
impl Default for FrameProfile
Source§fn default() -> FrameProfile
fn default() -> FrameProfile
Auto Trait Implementations§
impl Freeze for FrameProfile
impl RefUnwindSafe for FrameProfile
impl Send for FrameProfile
impl Sync for FrameProfile
impl Unpin for FrameProfile
impl UnsafeUnpin for FrameProfile
impl UnwindSafe for FrameProfile
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
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
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> ⓘ
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 moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().