pub struct CentralizedRequestLogger { /* private fields */ }Expand description
Centralized request logger that all servers can write to
Implementations§
Source§impl CentralizedRequestLogger
impl CentralizedRequestLogger
Sourcepub async fn log_request(&self, entry: RequestLogEntry)
pub async fn log_request(&self, entry: RequestLogEntry)
Log a new request entry
Sourcepub async fn get_recent_logs(
&self,
limit: Option<usize>,
) -> Vec<RequestLogEntry>
pub async fn get_recent_logs( &self, limit: Option<usize>, ) -> Vec<RequestLogEntry>
Get recent logs (most recent first)
Sourcepub async fn get_logs_by_server(
&self,
server_type: &str,
limit: Option<usize>,
) -> Vec<RequestLogEntry>
pub async fn get_logs_by_server( &self, server_type: &str, limit: Option<usize>, ) -> Vec<RequestLogEntry>
Get logs filtered by server type
Sourcepub async fn get_request_counts_by_server(&self) -> HashMap<String, u64>
pub async fn get_request_counts_by_server(&self) -> HashMap<String, u64>
Get total request count by server type
Sourcepub async fn clear_logs(&self)
pub async fn clear_logs(&self)
Clear all logs
Sourcepub async fn find_matching_requests(
&self,
pattern: &VerificationRequest,
) -> Vec<RequestLogEntry>
pub async fn find_matching_requests( &self, pattern: &VerificationRequest, ) -> Vec<RequestLogEntry>
Find all request log entries that match the verification pattern
This method is used by the verification API to find matching requests. It returns all log entries that match the given pattern, ordered by timestamp (most recent first).
Sourcepub async fn count_matching_requests(
&self,
pattern: &VerificationRequest,
) -> usize
pub async fn count_matching_requests( &self, pattern: &VerificationRequest, ) -> usize
Count request log entries that match the verification pattern
This is a convenience method that returns just the count of matching requests without collecting all the matching entries, which is more efficient when you only need the count.
Sourcepub async fn get_request_sequence(
&self,
patterns: &[VerificationRequest],
) -> Vec<RequestLogEntry>
pub async fn get_request_sequence( &self, patterns: &[VerificationRequest], ) -> Vec<RequestLogEntry>
Get request sequence matching the given patterns in order
This method finds requests that match the patterns in the specified order, which is useful for verifying request sequences. It returns the matching entries in the order they were found (chronological order).
Trait Implementations§
Source§impl Clone for CentralizedRequestLogger
impl Clone for CentralizedRequestLogger
Source§fn clone(&self) -> CentralizedRequestLogger
fn clone(&self) -> CentralizedRequestLogger
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CentralizedRequestLogger
impl Debug for CentralizedRequestLogger
Auto Trait Implementations§
impl Freeze for CentralizedRequestLogger
impl !RefUnwindSafe for CentralizedRequestLogger
impl Send for CentralizedRequestLogger
impl Sync for CentralizedRequestLogger
impl Unpin for CentralizedRequestLogger
impl !UnwindSafe for CentralizedRequestLogger
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
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>
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>
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