pub struct Metrics { /* private fields */ }Expand description
Metrics collector for Thread Flow operations
Implementations§
Source§impl Metrics
impl Metrics
Sourcepub fn record_cache_hit(&self)
pub fn record_cache_hit(&self)
Record a cache hit
Sourcepub fn record_cache_miss(&self)
pub fn record_cache_miss(&self)
Record a cache miss
Sourcepub fn record_query_latency(&self, latency_ms: u64)
pub fn record_query_latency(&self, latency_ms: u64)
Record query latency in milliseconds
Sourcepub fn record_fingerprint_time(&self, time_ns: u64)
pub fn record_fingerprint_time(&self, time_ns: u64)
Record fingerprint computation time in nanoseconds
Sourcepub fn record_parse_time(&self, time_us: u64)
pub fn record_parse_time(&self, time_us: u64)
Record parse time in microseconds
Sourcepub fn record_files_processed(&self, count: u64)
pub fn record_files_processed(&self, count: u64)
Record files processed
Sourcepub fn record_symbols_extracted(&self, count: u64)
pub fn record_symbols_extracted(&self, count: u64)
Record symbols extracted
Sourcepub fn record_error(&self, error_type: impl Into<String>)
pub fn record_error(&self, error_type: impl Into<String>)
Record an error by type
Sourcepub fn snapshot(&self) -> MetricsSnapshot
pub fn snapshot(&self) -> MetricsSnapshot
Get a snapshot of current metrics
Sourcepub fn export_prometheus(&self) -> String
pub fn export_prometheus(&self) -> String
Export metrics in Prometheus format
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Metrics
impl RefUnwindSafe for Metrics
impl Send for Metrics
impl Sync for Metrics
impl Unpin for Metrics
impl UnsafeUnpin for Metrics
impl UnwindSafe for Metrics
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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