pub struct TaskMonitorCoreBuilder { /* private fields */ }Expand description
Provides an interface for constructing a TaskMonitorCore with specialized configuration
parameters.
use std::time::Duration;
use tokio_metrics::TaskMonitorCoreBuilder;
static MONITOR: tokio_metrics::TaskMonitorCore = TaskMonitorCoreBuilder::new()
.with_slow_poll_threshold(Duration::from_micros(100))
.build();Implementations§
Source§impl TaskMonitorCoreBuilder
impl TaskMonitorCoreBuilder
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Creates a new TaskMonitorCoreBuilder.
Sourcepub const fn with_slow_poll_threshold(self, threshold: Duration) -> Self
pub const fn with_slow_poll_threshold(self, threshold: Duration) -> Self
Specifies the threshold at which polls are considered ‘slow’.
Sourcepub const fn with_long_delay_threshold(self, threshold: Duration) -> Self
pub const fn with_long_delay_threshold(self, threshold: Duration) -> Self
Specifies the threshold at which schedules are considered ‘long’.
Sourcepub const fn build(self) -> TaskMonitorCore
pub const fn build(self) -> TaskMonitorCore
Consume the builder, producing a TaskMonitorCore.
Trait Implementations§
Source§impl Clone for TaskMonitorCoreBuilder
impl Clone for TaskMonitorCoreBuilder
Source§fn clone(&self) -> TaskMonitorCoreBuilder
fn clone(&self) -> TaskMonitorCoreBuilder
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 TaskMonitorCoreBuilder
impl Debug for TaskMonitorCoreBuilder
Source§impl Default for TaskMonitorCoreBuilder
impl Default for TaskMonitorCoreBuilder
Source§fn default() -> TaskMonitorCoreBuilder
fn default() -> TaskMonitorCoreBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TaskMonitorCoreBuilder
impl RefUnwindSafe for TaskMonitorCoreBuilder
impl Send for TaskMonitorCoreBuilder
impl Sync for TaskMonitorCoreBuilder
impl Unpin for TaskMonitorCoreBuilder
impl UnsafeUnpin for TaskMonitorCoreBuilder
impl UnwindSafe for TaskMonitorCoreBuilder
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