pub struct PerfLogger { /* private fields */ }Implementations§
Source§impl PerfLogger
impl PerfLogger
pub fn new<T: Display>(scenario: T, enable_logging: bool) -> Self
pub fn new_disk_index_build_logger() -> Self
Sourcepub fn log_checkpoint<T: Display>(&mut self, checkpoint: T)
pub fn log_checkpoint<T: Display>(&mut self, checkpoint: T)
Logs the time elapsed since the last checkpoint or since the logger was created.
This method calculates the elapsed time, logs it with the provided checkpoint name, and then resets the start time to the current time. If logging is not enabled, this method does nothing.
§Arguments
checkpoint- A string slice that holds the name of the checkpoint.
§Examples
use diskann_disk::utils::instrumentation::PerfLogger;
let mut logger = PerfLogger::new("Scenario".to_string(), true);
logger.log_checkpoint("Checkpoint1");Sourcepub fn log_enabled(&self) -> bool
pub fn log_enabled(&self) -> bool
Returns whether logging is enabled for the perf logger.
Auto Trait Implementations§
impl Freeze for PerfLogger
impl RefUnwindSafe for PerfLogger
impl Send for PerfLogger
impl Sync for PerfLogger
impl Unpin for PerfLogger
impl UnwindSafe for PerfLogger
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more