pub struct HistogramOpts {
pub common_opts: Opts,
pub buckets: Vec<f64, Global>,
}
Expand description
A struct that bundles the options for creating a Histogram
metric. It is
mandatory to set Name and Help to a non-empty string. All other fields are
optional and can safely be left at their zero value.
Fields§
§common_opts: Opts
A container holding various options.
buckets: Vec<f64, Global>
Defines the buckets into which observations are counted. Each element in the slice is the upper inclusive bound of a bucket. The values must be sorted in strictly increasing order. There is no need to add a highest bucket with +Inf bound, it will be added implicitly. The default value is DefBuckets.
Implementations§
source§impl HistogramOpts
impl HistogramOpts
sourcepub fn new<S1, S2>(name: S1, help: S2) -> HistogramOptswhere
S1: Into<String>,
S2: Into<String>,
pub fn new<S1, S2>(name: S1, help: S2) -> HistogramOptswhere S1: Into<String>, S2: Into<String>,
Create a HistogramOpts
with the name
and help
arguments.
sourcepub fn namespace<S>(self, namespace: S) -> HistogramOptswhere
S: Into<String>,
pub fn namespace<S>(self, namespace: S) -> HistogramOptswhere S: Into<String>,
namespace
sets the namespace.
sourcepub fn subsystem<S>(self, subsystem: S) -> HistogramOptswhere
S: Into<String>,
pub fn subsystem<S>(self, subsystem: S) -> HistogramOptswhere S: Into<String>,
subsystem
sets the sub system.
sourcepub fn const_labels(
self,
const_labels: HashMap<String, String, RandomState>
) -> HistogramOpts
pub fn const_labels( self, const_labels: HashMap<String, String, RandomState> ) -> HistogramOpts
const_labels
sets the const labels.
sourcepub fn const_label<S1, S2>(self, name: S1, value: S2) -> HistogramOptswhere
S1: Into<String>,
S2: Into<String>,
pub fn const_label<S1, S2>(self, name: S1, value: S2) -> HistogramOptswhere S1: Into<String>, S2: Into<String>,
const_label
adds a const label.
sourcepub fn variable_labels(
self,
variable_labels: Vec<String, Global>
) -> HistogramOpts
pub fn variable_labels( self, variable_labels: Vec<String, Global> ) -> HistogramOpts
variable_labels
sets the variable labels.
sourcepub fn variable_label<S>(self, name: S) -> HistogramOptswhere
S: Into<String>,
pub fn variable_label<S>(self, name: S) -> HistogramOptswhere S: Into<String>,
variable_label
adds a variable label.
Trait Implementations§
source§impl Clone for HistogramOpts
impl Clone for HistogramOpts
source§fn clone(&self) -> HistogramOpts
fn clone(&self) -> HistogramOpts
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more