pub struct TimingMiddleware { /* private fields */ }Expand description
Middleware that measures query execution time.
This is a lightweight middleware that only adds timing information
to the response. For more comprehensive metrics, use MetricsMiddleware.
Implementations§
Source§impl TimingMiddleware
impl TimingMiddleware
Sourcepub fn total_time_ns(&self) -> u64
pub fn total_time_ns(&self) -> u64
Get the total execution time in nanoseconds.
Sourcepub fn total_time_us(&self) -> u64
pub fn total_time_us(&self) -> u64
Get the total execution time in microseconds.
Sourcepub fn total_time_ms(&self) -> u64
pub fn total_time_ms(&self) -> u64
Get the total execution time in milliseconds.
Sourcepub fn query_count(&self) -> u64
pub fn query_count(&self) -> u64
Get the number of queries timed.
Sourcepub fn avg_time_ns(&self) -> u64
pub fn avg_time_ns(&self) -> u64
Get the average execution time in nanoseconds.
Sourcepub fn avg_time_us(&self) -> u64
pub fn avg_time_us(&self) -> u64
Get the average execution time in microseconds.
Trait Implementations§
Source§impl Default for TimingMiddleware
impl Default for TimingMiddleware
Source§impl Middleware for TimingMiddleware
impl Middleware for TimingMiddleware
Source§fn handle<'a>(
&'a self,
ctx: QueryContext,
next: Next<'a>,
) -> BoxFuture<'a, MiddlewareResult<QueryResponse>>
fn handle<'a>( &'a self, ctx: QueryContext, next: Next<'a>, ) -> BoxFuture<'a, MiddlewareResult<QueryResponse>>
Handle a query, optionally calling the next handler.
Auto Trait Implementations§
impl !Freeze for TimingMiddleware
impl RefUnwindSafe for TimingMiddleware
impl Send for TimingMiddleware
impl Sync for TimingMiddleware
impl Unpin for TimingMiddleware
impl UnwindSafe for TimingMiddleware
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