pub struct SlowQueryStore { /* private fields */ }Expand description
Bounded ring buffer holding the most-recent cap slow-query events.
Thread-safe via a Mutex<VecDeque>. The lock is held only for
above-threshold, sampled events so contention is minimal.
Implementations§
Source§impl SlowQueryStore
impl SlowQueryStore
pub fn new(cap: usize) -> Arc<SlowQueryStore> ⓘ
Sourcepub fn push(&self, event: SlowQueryEvent)
pub fn push(&self, event: SlowQueryEvent)
Append an event; evicts the oldest record when the ring is at capacity.
Sourcepub fn read(&self, filter: &SlowQueryFilter) -> Vec<SlowQueryEvent>
pub fn read(&self, filter: &SlowQueryFilter) -> Vec<SlowQueryEvent>
Return recent events, most-recent first, applying filter.
This is the pure read-model layer; it never touches the filesystem and holds the lock only for the duration of the linear scan.
pub fn is_empty(&self) -> bool
Auto Trait Implementations§
impl !Freeze for SlowQueryStore
impl RefUnwindSafe for SlowQueryStore
impl Send for SlowQueryStore
impl Sync for SlowQueryStore
impl Unpin for SlowQueryStore
impl UnsafeUnpin for SlowQueryStore
impl UnwindSafe for SlowQueryStore
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request