pub struct HistogramVec {
pub name: &'static str,
/* private fields */
}
Expand description
A Histogram Vec for Hyperlight A named bundle of histograms
Fields§
§name: &'static str
The name of the histogram vec
Implementations§
Source§impl HistogramVec
impl HistogramVec
Sourcepub fn new(
name: &'static str,
help: &str,
labels: &[&str],
buckets: Vec<f64>,
) -> Result<Self>
pub fn new( name: &'static str, help: &str, labels: &[&str], buckets: Vec<f64>, ) -> Result<Self>
Creates a new histogram vec and registers it with the metric registry
Sourcepub fn observe(&self, label_vals: &[&str], val: f64) -> Result<()>
pub fn observe(&self, label_vals: &[&str], val: f64) -> Result<()>
Observes a value for a HistogramVec
Sourcepub fn get_sample_sum(&self, label_vals: &[&str]) -> Result<f64>
pub fn get_sample_sum(&self, label_vals: &[&str]) -> Result<f64>
Gets the sum of values of an HistogramVec
Sourcepub fn get_sample_count(&self, label_vals: &[&str]) -> Result<u64>
pub fn get_sample_count(&self, label_vals: &[&str]) -> Result<u64>
Gets the count of values of an HistogramVec
Trait Implementations§
Source§impl Debug for HistogramVec
impl Debug for HistogramVec
Source§impl From<HistogramVec> for HyperlightMetric
impl From<HistogramVec> for HyperlightMetric
Source§fn from(histogram_vec: HistogramVec) -> Self
fn from(histogram_vec: HistogramVec) -> Self
Converts to this type from the input type.
Source§impl<S: HyperlightMetricOps> GetHyperlightMetric<HistogramVec> for S
impl<S: HyperlightMetricOps> GetHyperlightMetric<HistogramVec> for S
Source§fn metric(&self) -> Result<&HistogramVec>
fn metric(&self) -> Result<&HistogramVec>
Converts the metric into a HyperlightMetric
Source§impl<'a> TryFrom<&'a HyperlightMetric> for &'a HistogramVec
impl<'a> TryFrom<&'a HyperlightMetric> for &'a HistogramVec
Source§type Error = HyperlightError
type Error = HyperlightError
The type returned in the event of a conversion error.
Source§fn try_from(metric: &'a HyperlightMetric) -> Result<Self>
fn try_from(metric: &'a HyperlightMetric) -> Result<Self>
Performs the conversion.
Auto Trait Implementations§
impl Freeze for HistogramVec
impl !RefUnwindSafe for HistogramVec
impl Send for HistogramVec
impl Sync for HistogramVec
impl Unpin for HistogramVec
impl !UnwindSafe for HistogramVec
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
Mutably borrows from an owned value. Read more