pub struct Gauge { /* private fields */ }Expand description
A signed gauge whose value may go up, down, or be set to an
absolute number. Backed by AtomicI64 because Prometheus gauges
are unrestricted-sign floats; we clamp to i64 here because every
data-plane gauge in the workspace (open sessions, queue depth,
spool bytes) is a non-negative count that fits comfortably in
63 bits, and the signed representation lets sub_saturating
bottom out at 0 rather than wrap.
Implementations§
Source§impl Gauge
impl Gauge
Sourcepub fn set(&self, value: u64)
pub fn set(&self, value: u64)
Set the gauge to an absolute value. Truncates to i64::MAX
on overflow — no data-plane count in the workspace is even
close to that ceiling, and silently overflowing to a
negative value would produce misleading dashboards.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Gauge
impl RefUnwindSafe for Gauge
impl Send for Gauge
impl Sync for Gauge
impl Unpin for Gauge
impl UnsafeUnpin for Gauge
impl UnwindSafe for Gauge
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