pub struct MetricsHandle { /* private fields */ }Expand description
Handle to the installed exporter. Cheap to clone.
Implementations§
Source§impl MetricsHandle
impl MetricsHandle
Sourcepub fn render(&self) -> String
pub fn render(&self) -> String
Render the current exposition-format snapshot (empty for the no-op exporter).
Sourcepub fn render_fn(&self) -> Arc<dyn Fn() -> String + Sync + Send> ⓘ
pub fn render_fn(&self) -> Arc<dyn Fn() -> String + Sync + Send> ⓘ
The render function seam handed to the admin server, keeping it independent of exporter internals.
Sourcepub fn upkeep_tick(&self)
pub fn upkeep_tick(&self)
One maintenance tick: drains histogram state and refreshes process metrics. Cheap; call on an interval.
Sourcepub fn spawn_upkeep(&self, period: Duration) -> JoinHandle<()>
pub fn spawn_upkeep(&self, period: Duration) -> JoinHandle<()>
Spawn the periodic upkeep task on the current tokio runtime.
Trait Implementations§
Source§impl Clone for MetricsHandle
impl Clone for MetricsHandle
Source§fn clone(&self) -> MetricsHandle
fn clone(&self) -> MetricsHandle
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for MetricsHandle
impl RefUnwindSafe for MetricsHandle
impl Send for MetricsHandle
impl Sync for MetricsHandle
impl Unpin for MetricsHandle
impl UnsafeUnpin for MetricsHandle
impl UnwindSafe for MetricsHandle
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
Casts
self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read moreSource§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