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
Trait Implementations§
Source§impl Clone for CentralizedRequestLogger
impl Clone for CentralizedRequestLogger
Source§fn clone(&self) -> CentralizedRequestLogger
fn clone(&self) -> CentralizedRequestLogger
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
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
Mutably borrows from an owned value. Read more