pub struct CacheSizeMetrics {
gauges: IntGaugeVec,
sources: Arc<Mutex<Vec<CacheSizeSource>>>,
}Expand description
Cache byte metrics combining manually maintained gauges and sampled cache weights. Sampling does not force backend maintenance or include pending loader values.
Fields§
§gauges: IntGaugeVec§sources: Arc<Mutex<Vec<CacheSizeSource>>>Implementations§
Source§impl CacheSizeMetrics
impl CacheSizeMetrics
Sourcepub fn new(opts: Opts, labels: &[&str]) -> Result<Self>
pub fn new(opts: Opts, labels: &[&str]) -> Result<Self>
Creates an unregistered collector. Register a clone with the caller’s registry.
Sourcepub fn gauges(&self) -> &IntGaugeVec
pub fn gauges(&self) -> &IntGaugeVec
Returns the backing gauges for callers retaining manual accounting.
Sourcepub fn with_label_values(&self, labels: &[&str]) -> IntGauge
pub fn with_label_values(&self, labels: &[&str]) -> IntGauge
Returns a manually maintained gauge for existing non-cache accounting.
Sourcepub fn bind(&self, labels: &[&str]) -> CacheSizeMetric
pub fn bind(&self, labels: &[&str]) -> CacheSizeMetric
Binds labels for sampled cache weights. Instances sharing labels are summed.
Trait Implementations§
Source§impl Clone for CacheSizeMetrics
impl Clone for CacheSizeMetrics
Source§fn clone(&self) -> CacheSizeMetrics
fn clone(&self) -> CacheSizeMetrics
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for CacheSizeMetrics
impl !UnwindSafe for CacheSizeMetrics
impl Freeze for CacheSizeMetrics
impl Send for CacheSizeMetrics
impl Sync for CacheSizeMetrics
impl Unpin for CacheSizeMetrics
impl UnsafeUnpin for CacheSizeMetrics
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