pub struct RuntimeMetrics { /* private fields */ }Expand description
Bounded-label Prometheus metrics and readiness for a supervisor.
Implementations§
Source§impl RuntimeMetrics
impl RuntimeMetrics
Sourcepub fn new(now_ms: i64, prefix: impl Into<String>) -> Self
pub fn new(now_ms: i64, prefix: impl Into<String>) -> Self
Metrics named with prefix, initialised at now_ms.
Sourcepub fn record_pass(
&self,
now_ms: i64,
duration_ms: u64,
claimed: u64,
failed: u64,
)
pub fn record_pass( &self, now_ms: i64, duration_ms: u64, claimed: u64, failed: u64, )
Record one completed supervisor pass.
Sourcepub fn record_pass_failure(&self)
pub fn record_pass_failure(&self)
Count a pass that failed as a whole.
Sourcepub fn record_overrun(&self)
pub fn record_overrun(&self)
Count a pass that exceeded its interval.
Sourcepub fn record_backlog(&self)
pub fn record_backlog(&self)
Count a pass that left due work unclaimed.
Sourcepub fn set_gauges(&self, active: i64, due: i64, stalled: i64)
pub fn set_gauges(&self, active: i64, due: i64, stalled: i64)
Set the instance gauges.
Sourcepub fn readiness(&self, now_ms: i64, interval_secs: u64) -> Readiness
pub fn readiness(&self, now_ms: i64, interval_secs: u64) -> Readiness
Readiness derived from the age of the last pass.
Sourcepub fn render_prometheus(&self, now_ms: i64) -> String
pub fn render_prometheus(&self, now_ms: i64) -> String
Text exposition format.
Auto Trait Implementations§
impl !Freeze for RuntimeMetrics
impl RefUnwindSafe for RuntimeMetrics
impl Send for RuntimeMetrics
impl Sync for RuntimeMetrics
impl Unpin for RuntimeMetrics
impl UnsafeUnpin for RuntimeMetrics
impl UnwindSafe for RuntimeMetrics
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