pub struct Profiler {
pub enabled: bool,
pub frame_history: VecDeque<FrameProfile>,
pub max_history: usize,
pub current_frame: Option<FrameProfile>,
pub frame_counter: u64,
pub budget: PerformanceBudget,
pub budget_violations: Vec<BudgetReport>,
pub stats: HashMap<String, StatRingBuffer>,
pub capture_flamegraph: bool,
pub flamegraph_history: VecDeque<FlamegraphNode>,
/* private fields */
}Fields§
§enabled: bool§frame_history: VecDeque<FrameProfile>§max_history: usize§current_frame: Option<FrameProfile>§frame_counter: u64§budget: PerformanceBudget§budget_violations: Vec<BudgetReport>§stats: HashMap<String, StatRingBuffer>§capture_flamegraph: bool§flamegraph_history: VecDeque<FlamegraphNode>Implementations§
Source§impl Profiler
impl Profiler
pub fn new() -> Self
pub fn register_stat(&mut self, name: &str, unit: CounterUnit, capacity: usize)
pub fn advance_sim_time(&mut self, us: u64)
pub fn begin_frame(&mut self)
pub fn end_frame(&mut self, frame_ms: f64)
pub fn begin_span(&mut self, name: &str, kind: SpanKind) -> SpanId
pub fn end_span(&mut self, id: SpanId)
pub fn record_counter(&mut self, name: &str, value: f64, unit: CounterUnit)
pub fn record_memory(&mut self, mem: MemorySnapshot)
pub fn fps(&self) -> f64
pub fn frame_ms(&self) -> f64
pub fn mean_fps(&self) -> f64
pub fn p95_frame_ms(&self) -> f64
pub fn latest_frame(&self) -> Option<&FrameProfile>
pub fn latest_flamegraph(&self) -> Option<&FlamegraphNode>
pub fn stat(&self, name: &str) -> Option<&StatRingBuffer>
pub fn summary_line(&self) -> String
pub fn detailed_summary(&self) -> String
pub fn reset_stats(&mut self)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Profiler
impl RefUnwindSafe for Profiler
impl Send for Profiler
impl Sync for Profiler
impl Unpin for Profiler
impl UnsafeUnpin for Profiler
impl UnwindSafe for Profiler
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.