pub struct Recorder { /* private fields */ }Expand description
The one observer: per-definition counts, optionally timed, optionally tracing some definitions.
Implementations§
Source§impl Recorder
impl Recorder
Sourcepub fn new(defs: Arc<Definitions>, timed: bool, tracer: Option<Tracer>) -> Self
pub fn new(defs: Arc<Definitions>, timed: bool, tracer: Option<Tracer>) -> Self
timed reads the clock twice per activation; coverage leaves it off.
Sourcepub fn report(&self) -> Vec<Measured>
pub fn report(&self) -> Vec<Measured>
Every function that ran, with what it cost, and every definition that did not run with zero calls: the profile and the coverage in one table.
pub fn definitions(&self) -> &Definitions
Sourcepub fn counts_allocations(&self) -> bool
pub fn counts_allocations(&self) -> bool
Whether the allocation columns of Counts were measured: true only
in a binary that installs crate::alloc::Counting. Elsewhere they
read zero, which means unmeasured, never “allocated nothing”.
Trait Implementations§
Source§impl CallObserver for Recorder
impl CallObserver for Recorder
Source§fn enter(&self, call: &Call<'_>, args: &[Value]) -> Option<Value>
fn enter(&self, call: &Call<'_>, args: &[Value]) -> Option<Value>
Before the body runs, with the arguments bound.
None lets it run;
Some(value) makes value the call’s result without running the body
(a memo table answering), and leave then sees Exit::Supplied.fn leave(&self, _call: &Call<'_>, exit: Exit<'_>)
Auto Trait Implementations§
impl !Freeze for Recorder
impl !RefUnwindSafe for Recorder
impl !UnwindSafe for Recorder
impl Send for Recorder
impl Sync for Recorder
impl Unpin for Recorder
impl UnsafeUnpin for Recorder
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