pub struct TaskMetricsReporter { /* private fields */ }Available on crate features
rt and metrics-rs-integration only.Expand description
Collects metrics from a Tokio task and uploads them to metrics_rs.
Implementations§
Source§impl TaskMetricsReporter
impl TaskMetricsReporter
Sourcepub fn run_once(&mut self)
pub fn run_once(&mut self)
Collect and publish metrics once to the configured metrics_rs reporter.
Sourcepub async fn run(self)
pub async fn run(self)
Collect and publish metrics periodically to the configured metrics_rs reporter.
You probably want to run this within its own task (using tokio::task::spawn)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TaskMetricsReporter
impl !RefUnwindSafe for TaskMetricsReporter
impl Send for TaskMetricsReporter
impl Sync for TaskMetricsReporter
impl Unpin for TaskMetricsReporter
impl !UnwindSafe for TaskMetricsReporter
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