pub struct CounterDescriptor {
pub iid: Option<u64>,
pub name: Option<String>,
pub unit_multiplier: Option<u64>,
pub description: Option<String>,
pub scope: Option<i32>,
pub unit_field: Option<UnitField>,
}Expand description
Describes a counter: a named, typed quantity a sample is measured against (the sampling timebase) or observed alongside (a follower). Values live on the sample as weights; this only describes their meaning.
Fields§
§iid: Option<u64>Interning key, used when this descriptor is emitted via InternedData.stack_sample_counter_descriptors and referenced by StackSample.primary_descriptor_iid. Starts from 1; 0 is the same as “not set”.
name: Option<String>Human-readable counter name, e.g. “cycles”, “wall-time”, “cache-misses”.
unit_multiplier: Option<u64>Scales raw weights to unit. E.g. unit=UNIT_BYTES, unit_multiplier=1024
means weights are in KiB. Absent means 1.
description: Option<String>Free-form description of what the counter measures.
scope: Option<i32>The scope of this counter’s instances. Absent means SCOPE_GLOBAL.
unit_field: Option<UnitField>The unit weights are expressed in. Set the well-known unit when one
fits, otherwise set unit_str to a custom label.
Implementations§
Source§impl CounterDescriptor
impl CounterDescriptor
Sourcepub fn unit_multiplier(&self) -> u64
pub fn unit_multiplier(&self) -> u64
Returns the value of unit_multiplier, or the default value if unit_multiplier is unset.
Sourcepub fn description(&self) -> &str
pub fn description(&self) -> &str
Returns the value of description, or the default value if description is unset.
Trait Implementations§
Source§impl Clone for CounterDescriptor
impl Clone for CounterDescriptor
Source§fn clone(&self) -> CounterDescriptor
fn clone(&self) -> CounterDescriptor
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CounterDescriptor
impl Debug for CounterDescriptor
Source§impl Default for CounterDescriptor
impl Default for CounterDescriptor
impl Eq for CounterDescriptor
Source§impl Hash for CounterDescriptor
impl Hash for CounterDescriptor
Source§impl Message for CounterDescriptor
impl Message for CounterDescriptor
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.Source§impl PartialEq for CounterDescriptor
impl PartialEq for CounterDescriptor
Source§fn eq(&self, other: &CounterDescriptor) -> bool
fn eq(&self, other: &CounterDescriptor) -> bool
self and other values to be equal, and is used by ==.