pub struct RequestTimer { /* private fields */ }Expand description
Request timer that automatically records duration to Prometheus when dropped.
This implements the RAII pattern for request timing. The duration is recorded when the timer goes out of scope.
§Example
ⓘ
let _timer = metrics.time_request("modbus", "read");
// ... perform the operation ...
// duration is automatically recorded when _timer is droppedImplementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RequestTimer
impl RefUnwindSafe for RequestTimer
impl Send for RequestTimer
impl Sync for RequestTimer
impl Unpin for RequestTimer
impl UnsafeUnpin for RequestTimer
impl UnwindSafe for RequestTimer
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