Struct prometrics::metrics::HistogramBuilder
[−]
[src]
pub struct HistogramBuilder { /* fields omitted */ }
Histogram
builder.
Methods
impl HistogramBuilder
[src]
pub fn new(name: &str) -> Self
[src]
Makes a builder for histograms named name
.
pub fn with_linear_buckets(
name: &str,
start: f64,
width: f64,
count: usize
) -> Self
[src]
name: &str,
start: f64,
width: f64,
count: usize
) -> Self
Makes a builder with the specified linear buckets.
pub fn with_exponential_buckets(
name: &str,
start: f64,
factor: f64,
count: usize
) -> Self
[src]
name: &str,
start: f64,
factor: f64,
count: usize
) -> Self
Makes a builder with the specified exponential buckets.
ⓘ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.
The name "le"
is reserved for designating buckets.
ⓘ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 histograms 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.
ⓘImportant traits for &'a mut Wpub fn bucket(&mut self, upper_bound: f64) -> &mut Self
[src]
ⓘImportant traits for &'a mut W
Adds a bucket.
pub fn finish(&self) -> Result<Histogram>
[src]
Builds a histogram.
Errors
This method will return Err(_)
if one of the following conditions is satisfied:
- Any of the name of the metric or labels is malformed
- There is a bucket whose upper bound is
NaN