[−][src]Struct prometrics::metrics::MetricBuilder
Common builder for various metrics.
Methods
impl MetricBuilder
[src]
pub fn new() -> Self
[src]
Makes a builder with the default registry.
pub fn with_registry(registry: Registry) -> Self
[src]
Makes a builder with the given registry.
pub fn without_registry() -> Self
[src]
Makes a builder without any registries.
pub fn namespace(&mut self, namespace: &str) -> &mut Self
[src]
Sets the namespace part of the metric name.
pub fn subsystem(&mut self, subsystem: &str) -> &mut Self
[src]
Sets the subsystem part of the metric name of this.
pub fn label(&mut self, name: &str, value: &str) -> &mut Self
[src]
Adds a label.
Note that name
will be validated when creating the metrics.
pub fn registry(&mut self, registry: Registry) -> &mut Self
[src]
Adds a registry to which the resulting metrics will be registered.
pub fn set_registry(&mut self, registry: Registry) -> &mut Self
[src]
Clears the current registries, then sets registry
as the new one.
pub fn counter(&self, name: &str) -> CounterBuilder
[src]
Makes a CounterBuilder
that inherited the setting of this builder.
pub fn gauge(&self, name: &str) -> GaugeBuilder
[src]
Makes a GaugeBuilder
that inherited the setting of this builder.
pub fn histogram(&self, name: &str) -> HistogramBuilder
[src]
Makes a HistogramBuilder
that inherited the setting of this builder.
pub fn summary(&self, name: &str, window: Duration) -> SummaryBuilder
[src]
Makes a SummaryBuilder
that inherited the setting of this builder.
Trait Implementations
impl Clone for MetricBuilder
[src]
fn clone(&self) -> MetricBuilder
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for MetricBuilder
[src]
impl Default for MetricBuilder
[src]
Auto Trait Implementations
impl !RefUnwindSafe for MetricBuilder
impl Send for MetricBuilder
impl !Sync for MetricBuilder
impl Unpin for MetricBuilder
impl !UnwindSafe for MetricBuilder
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,