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 + Send + Sync> ⓘ
pub fn render_fn(&self) -> Arc<dyn Fn() -> String + Send + Sync> ⓘ
The render function seam handed to the admin server.
Sourcepub fn exports(&self) -> bool
pub fn exports(&self) -> bool
Whether this handle renders an exposition. False for the no-op exporter and for the detached handle a foreign recorder leaves behind.
The admin server serves /metrics only when it does, so a scrape of a
pipeline exporting nothing is a 404 rather than an empty success.
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§
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