pub struct MetricsHub {
queries: Mutex<VecDeque<QueryTrace>>,
histogram: Mutex<Histogram>,
usn: Mutex<VecDeque<UsnTrace>>,
scans: Mutex<VecDeque<ScanTrace>>,
pub counters: Counters,
}Expand description
Thread-safe metrics collector owned by the engine.
Fields§
§queries: Mutex<VecDeque<QueryTrace>>§histogram: Mutex<Histogram>§usn: Mutex<VecDeque<UsnTrace>>§scans: Mutex<VecDeque<ScanTrace>>§counters: CountersProcess-wide degradation counters.
Implementations§
Source§impl MetricsHub
impl MetricsHub
Sourcepub fn record_query(&self, trace: QueryTrace)
pub fn record_query(&self, trace: QueryTrace)
Record a query trace into the ring and its latency into the histogram.
Sourcepub fn record_usn(&self, trace: UsnTrace)
pub fn record_usn(&self, trace: UsnTrace)
Record a USN-batch trace into the ring.
Sourcepub fn record_scan(&self, trace: ScanTrace)
pub fn record_scan(&self, trace: ScanTrace)
Record an index-established (scan/snapshot) trace into the ring.
Sourcepub fn last_query(&self) -> Option<QueryTrace>
pub fn last_query(&self) -> Option<QueryTrace>
The most recently recorded query trace, if any.
Sourcepub fn snapshot(
&self,
recent: usize,
indexes: Vec<IndexStats>,
) -> MetricsSnapshot
pub fn snapshot( &self, recent: usize, indexes: Vec<IndexStats>, ) -> MetricsSnapshot
Snapshot with the most recent recent queries (newest last).
Trait Implementations§
Source§impl Default for MetricsHub
impl Default for MetricsHub
Source§fn default() -> MetricsHub
fn default() -> MetricsHub
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for MetricsHub
impl !RefUnwindSafe for MetricsHub
impl Send for MetricsHub
impl Sync for MetricsHub
impl Unpin for MetricsHub
impl UnsafeUnpin for MetricsHub
impl UnwindSafe for MetricsHub
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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