Skip to main content

PerfSnapshot

Struct PerfSnapshot 

Source
pub struct PerfSnapshot {
Show 17 fields pub fps: f32, pub max_fps: f32, pub refresh_rate: Option<f32>, pub tick_interval: Stat, pub frame_interval: Stat, pub frame: Stat, pub dropped: f32, pub commits: f32, pub js: Stat, pub layout: Stat, pub items: f32, pub latency: Stat, pub engine_busy: f32, pub frames: Vec<Duration>, pub process: ProcessSample, pub memory: Option<MemorySample>, pub gc: GcSample,
}
Expand description

What a PerfMonitor read, as of one moment.

Fields§

§fps: f32

Frames shown per second over the last second: display refreshes in which the surface changed. Low while the app is idle, which is not slowness.

§max_fps: f32

What the main thread could keep up with: one over the mean frame cost, capped at the display’s rate when it is known.

§refresh_rate: Option<f32>

The rate the display link asks for (Hz: its period), once it ran.

§tick_interval: Stat

The gaps between refreshes as they were delivered, over the last [CAPACITY]: a mean above one period means refreshes came late or were skipped (a main thread busy when they were due).

§frame_interval: Stat

The gaps between shown frames over the last [CAPACITY] (long while the app is idle, one period while it animates smoothly).

§frame: Stat

Main-thread time per shown frame (applying batches, animations, input), over the last [CAPACITY] frames.

§dropped: f32

Share of those frames that took longer than one refresh, in 0..=1.

§commits: f32

Commits per second over the last second.

§js: Stat

The app’s code per commit, over the commits of the last [COMMIT_WINDOW] (none while the app made none).

§layout: Stat

The core’s work per commit, over the same commits.

§items: f32

Mean mount items per commit, over the same commits.

§latency: Stat

How long batches waited between the engine thread handing them over and the main thread applying them.

§engine_busy: f32

The engine thread’s busy time over the last second, in percent.

§frames: Vec<Duration>

Main-thread cost of the retained frames, oldest first (for a trace).

§process: ProcessSample

The process’ resource use, as last given to PerfMonitor::set_process.

§memory: Option<MemorySample>

What the app holds, as last given to PerfMonitor::set_memory: read after each idle collection, and every few seconds without one; none before the first.

§gc: GcSample

The engine’s idle collections over the last few seconds.

Implementations§

Source§

impl PerfSnapshot

Source

pub fn stats(&self) -> PerfStats

What apps read of it (perfStats(), nsh_core::element::perf_stats).

Trait Implementations§

Source§

impl Clone for PerfSnapshot

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PerfSnapshot

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for PerfSnapshot

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for PerfSnapshot

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for PerfSnapshot

Auto Trait Implementations§

§

impl Forget for PerfSnapshot

§

impl Freeze for PerfSnapshot

§

impl Move for PerfSnapshot

§

impl RefUnwindSafe for PerfSnapshot

§

impl Send for PerfSnapshot
where RawVecInner: Send,

§

impl Sync for PerfSnapshot
where RawVecInner: Sync,

§

impl Unpin for PerfSnapshot
where *const u8 is !null: Unpin,

§

impl UnsafeUnpin for PerfSnapshot

§

impl UnwindSafe for PerfSnapshot
where RawVecInner: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ParallelSend for T

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more