Skip to main content

PerfReportPlugin

Struct PerfReportPlugin 

Source
pub struct PerfReportPlugin { /* private fields */ }
Expand description

Per-frame perf reporter: accumulates span and per-system timings, emits a PerfReport callback every frames_per_report frames, optionally writes Chrome-trace JSON to a file.

Inserts

  • resource: PerfAccum (private)
  • system: none
  • view: none
  • entity: none
  • hooks: post_render (drains crate::perf events; emits report at window boundary)

Implementations§

Source§

impl PerfReportPlugin

Source

pub fn new(frames_per_report: u32) -> Self

Source

pub fn with_sink(self, sink: fn(&PerfReport)) -> Self

Source

pub fn with_perfetto_line_sink(self, sink: PerfettoLineSink) -> Self

Write each drained event as one chrome-JSON line through sink. Open the resulting NDJSON in https://ui.perfetto.dev. Works on no_std; ESP backends pass an esp_println shim.

Trait Implementations§

Source§

impl Default for PerfReportPlugin

Source§

fn default() -> Self

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

impl<B, F> Plugin<B, F> for PerfReportPlugin
where B: Surface, F: RendererFactory<B>,

Source§

fn build(&mut self, app: &mut App<B, F>)

Source§

fn post_render(&mut self, world: &mut World, _render_nanos: u64)

render_nanos covers layout + render walker only; flush and prev-rect seeding are excluded. Zero when no clock plugin is installed.
Source§

fn pre_render(&mut self, _world: &mut World)

Source§

fn on_event(&mut self, _world: &mut World, _event: &InputEvent) -> bool

Inspect each input event before it reaches widgets. Return true to mark the event consumed; App will skip widget-level dispatch for that event.
Source§

fn on_quit(&mut self, _world: &mut World)

Source§

fn name(&self) -> &'static str

Auto Trait Implementations§

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.