Struct prometheus::PullingGauge
source · pub struct PullingGauge { /* private fields */ }
Expand description
A Gauge that returns the value from a provided function on every collect run.
This metric is the equivalant of Go’s https://pkg.go.dev/github.com/prometheus/client_golang@v1.11.0/prometheus#GaugeFunc
§Examples
let registry = Registry::new();
let gauge = PullingGauge::new(
"available_parallelism",
"The available parallelism, usually the numbers of logical cores.",
Box::new(|| available_parallelism())
).unwrap();
registry.register(Box::new(gauge));
Implementations§
Trait Implementations§
source§impl Clone for PullingGauge
impl Clone for PullingGauge
source§fn clone(&self) -> PullingGauge
fn clone(&self) -> PullingGauge
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Collector for PullingGauge
impl Collector for PullingGauge
Auto Trait Implementations§
impl Freeze for PullingGauge
impl !RefUnwindSafe for PullingGauge
impl Send for PullingGauge
impl Sync for PullingGauge
impl Unpin for PullingGauge
impl !UnwindSafe for PullingGauge
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)