Struct prometrics::metrics::CounterBuilder
[−]
[src]
pub struct CounterBuilder { /* fields omitted */ }
Counter
builder.
Methods
impl CounterBuilder
[src]
pub fn new(name: &str) -> Self
[src]
Makes a builder for counters named name
.
ⓘImportant traits for &'a mut Wpub fn namespace(&mut self, namespace: &str) -> &mut Self
[src]
ⓘImportant traits for &'a mut W
Sets the namespace part of the metric name of this.
ⓘImportant traits for &'a mut Wpub fn subsystem(&mut self, subsystem: &str) -> &mut Self
[src]
ⓘImportant traits for &'a mut W
Sets the subsystem part of the metric name of this.
ⓘImportant traits for &'a mut Wpub fn help(&mut self, help: &str) -> &mut Self
[src]
ⓘImportant traits for &'a mut W
Sets the help of this.
ⓘImportant traits for &'a mut Wpub fn label(&mut self, name: &str, value: &str) -> &mut Self
[src]
ⓘImportant traits for &'a mut W
Adds a label.
Note that name
will be validated in the invocation of the finish
method.
ⓘImportant traits for &'a mut Wpub fn registry(&mut self, registry: Registry) -> &mut Self
[src]
ⓘImportant traits for &'a mut W
Adds a registry to which the resulting counters will be registered.
ⓘImportant traits for &'a mut Wpub fn default_registry(&mut self) -> &mut Self
[src]
ⓘImportant traits for &'a mut W
Adds the default registry.
pub fn finish(&self) -> Result<Counter>
[src]
Builds a counter.
Errors
This method will return Err(_)
if any of the name of the metric or labels is malformed.