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(drainscrate::perfevents; emits report at window boundary)
Implementations§
Source§impl PerfReportPlugin
impl PerfReportPlugin
pub fn new(frames_per_report: u32) -> Self
pub fn with_sink(self, sink: fn(&PerfReport)) -> Self
Sourcepub fn with_perfetto_line_sink(self, sink: PerfettoLineSink) -> Self
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
impl Default for PerfReportPlugin
Source§impl<B, F> Plugin<B, F> for PerfReportPluginwhere
B: Surface,
F: RendererFactory<B>,
impl<B, F> Plugin<B, F> for PerfReportPluginwhere
B: Surface,
F: RendererFactory<B>,
fn build(&mut self, app: &mut App<B, F>)
Source§fn post_render(&mut self, world: &mut World, _render_nanos: u64)
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.fn pre_render(&mut self, _world: &mut World)
Source§fn on_event(&mut self, _world: &mut World, _event: &InputEvent) -> bool
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.fn on_quit(&mut self, _world: &mut World)
fn name(&self) -> &'static str
Auto Trait Implementations§
impl Freeze for PerfReportPlugin
impl !RefUnwindSafe for PerfReportPlugin
impl !Send for PerfReportPlugin
impl !Sync for PerfReportPlugin
impl Unpin for PerfReportPlugin
impl UnsafeUnpin for PerfReportPlugin
impl !UnwindSafe for PerfReportPlugin
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