pub struct HistogramOpts {
pub common_opts: Opts,
pub buckets: Vec<f64>,
}
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>
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§
§impl HistogramOpts
impl HistogramOpts
pub fn new<S1, S2>(name: S1, help: S2) -> HistogramOpts
pub fn new<S1, S2>(name: S1, help: S2) -> HistogramOpts
Create a HistogramOpts
with the name
and help
arguments.
pub fn namespace<S>(self, namespace: S) -> HistogramOpts
pub fn namespace<S>(self, namespace: S) -> HistogramOpts
namespace
sets the namespace.
pub fn subsystem<S>(self, subsystem: S) -> HistogramOpts
pub fn subsystem<S>(self, subsystem: S) -> HistogramOpts
subsystem
sets the sub system.
pub fn const_labels(
self,
const_labels: HashMap<String, String>,
) -> HistogramOpts
pub fn const_labels( self, const_labels: HashMap<String, String>, ) -> HistogramOpts
const_labels
sets the const labels.
pub fn const_label<S1, S2>(self, name: S1, value: S2) -> HistogramOpts
pub fn const_label<S1, S2>(self, name: S1, value: S2) -> HistogramOpts
const_label
adds a const label.
pub fn variable_labels(self, variable_labels: Vec<String>) -> HistogramOpts
pub fn variable_labels(self, variable_labels: Vec<String>) -> HistogramOpts
variable_labels
sets the variable labels.
pub fn variable_label<S>(self, name: S) -> HistogramOpts
pub fn variable_label<S>(self, name: S) -> HistogramOpts
variable_label
adds a variable label.
pub fn buckets(self, buckets: Vec<f64>) -> HistogramOpts
pub fn buckets(self, buckets: Vec<f64>) -> HistogramOpts
buckets
set the buckets.
Trait Implementations§
§impl Clone for HistogramOpts
impl Clone for HistogramOpts
§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§impl Debug for HistogramOpts
impl Debug for HistogramOpts
§impl Describer for HistogramOpts
impl Describer for HistogramOpts
§impl From<Opts> for HistogramOpts
impl From<Opts> for HistogramOpts
§fn from(opts: Opts) -> HistogramOpts
fn from(opts: Opts) -> HistogramOpts
Auto Trait Implementations§
impl Freeze for HistogramOpts
impl RefUnwindSafe for HistogramOpts
impl Send for HistogramOpts
impl Sync for HistogramOpts
impl Unpin for HistogramOpts
impl UnwindSafe for HistogramOpts
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)