Skip to main content

Profiler

Struct Profiler 

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

Performance profiler for tracking render performance

Implementations§

Source§

impl Profiler

Source

pub fn new() -> Self

Create a new profiler

Source

pub fn start_recording(&mut self)

Start recording

Source

pub fn stop_recording(&mut self)

Stop recording

Source

pub fn is_recording(&self) -> bool

Check if recording

Source

pub fn toggle_recording(&mut self)

Toggle recording

Source

pub fn start_frame(&mut self)

Start a new frame

Source

pub fn end_frame(&mut self)

End the current frame

Source

pub fn record_render(&mut self, event: RenderEvent)

Record a render event

Source

pub fn frame_count(&self) -> usize

Get frame count

Source

pub fn recording_duration(&self) -> Duration

Get total recording duration

Source

pub fn avg_frame_time(&self) -> Duration

Get average frame time

Source

pub fn stats_by_time(&self) -> Vec<&ComponentStats>

Get stats sorted by total time

Source

pub fn stats_by_count(&self) -> Vec<&ComponentStats>

Get stats sorted by render count

Source

pub fn view(&self) -> ProfilerView

Get current view

Source

pub fn set_view(&mut self, view: ProfilerView)

Set view

Source

pub fn next_view(&mut self)

Next view

Source

pub fn select_frame(&mut self, index: Option<usize>)

Select a frame

Source

pub fn scroll_up(&mut self)

Scroll up

Source

pub fn scroll_down(&mut self)

Scroll down

Source

pub fn clear(&mut self)

Clear all data

Source

pub fn render_content( &self, buffer: &mut Buffer, area: Rect, config: &DevToolsConfig, )

Render profiler content

Trait Implementations§

Source§

impl Default for Profiler

Source§

fn default() -> Self

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

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.