pub struct MetricDescriptor {
pub subsystem: &'static str,
pub name: &'static str,
pub help: &'static str,
pub kind: MetricKind,
pub labels: &'static [&'static str],
pub buckets: &'static [f64],
}Expand description
Static metric descriptor registered by a subsystem.
Fields§
§subsystem: &'static strOwning subsystem name.
name: &'static strMetric name without backend-specific namespace decoration.
help: &'static strHuman-readable help text.
kind: MetricKindMetric kind.
labels: &'static [&'static str]Ordered label names used by the metric.
buckets: &'static [f64]Optional histogram buckets.
Implementations§
Source§impl MetricDescriptor
impl MetricDescriptor
Sourcepub const fn counter(
subsystem: &'static str,
name: &'static str,
help: &'static str,
labels: &'static [&'static str],
) -> Self
pub const fn counter( subsystem: &'static str, name: &'static str, help: &'static str, labels: &'static [&'static str], ) -> Self
Creates a descriptor for a counter metric.
Sourcepub const fn gauge(
subsystem: &'static str,
name: &'static str,
help: &'static str,
labels: &'static [&'static str],
) -> Self
pub const fn gauge( subsystem: &'static str, name: &'static str, help: &'static str, labels: &'static [&'static str], ) -> Self
Creates a descriptor for a gauge metric.
Trait Implementations§
Source§impl Clone for MetricDescriptor
impl Clone for MetricDescriptor
Source§fn clone(&self) -> MetricDescriptor
fn clone(&self) -> MetricDescriptor
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 moreSource§impl Debug for MetricDescriptor
impl Debug for MetricDescriptor
Source§impl PartialEq for MetricDescriptor
impl PartialEq for MetricDescriptor
Source§fn eq(&self, other: &MetricDescriptor) -> bool
fn eq(&self, other: &MetricDescriptor) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for MetricDescriptor
Auto Trait Implementations§
impl Freeze for MetricDescriptor
impl RefUnwindSafe for MetricDescriptor
impl Send for MetricDescriptor
impl Sync for MetricDescriptor
impl Unpin for MetricDescriptor
impl UnsafeUnpin for MetricDescriptor
impl UnwindSafe for MetricDescriptor
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