#[repr(u8)]pub enum CounterResetHint {
Unknown = 0,
CounterReset = 1,
NotCounterReset = 2,
GaugeType = 3,
}Expand description
Counter-reset hint for one histogram sample.
Discriminants match Prometheus’ histogram.CounterResetHint, which is not
the same bit order as the 2-bit chunk header: the header uses
01/10 for not-reset/reset while the hint uses 1/2. The two are kept
apart so a round trip cannot silently swap them; Self::from_header_bits
does the translation.
Variants§
Unknown = 0
Unknown, the reader has to detect a reset itself.
CounterReset = 1
This sample starts after a counter reset.
NotCounterReset = 2
This sample definitely does not start a counter reset.
GaugeType = 3
Gauge histogram: counters do not reset at all.
Implementations§
Source§impl CounterResetHint
impl CounterResetHint
Sourcepub fn from_header_bits(bits: u8) -> Self
pub fn from_header_bits(bits: u8) -> Self
Maps the raw 2-bit chunk header onto the hint.
Sourcepub fn for_sample(chunk_hint: Self, sample_index: u64) -> Self
pub fn for_sample(chunk_hint: Self, sample_index: u64) -> Self
Per-sample hint, derived exactly like Prometheus’ counterResetHint:
gauge chunks stay gauge, every sample after the first cannot be a
reset, and everything else is conservatively “unknown”.