pub enum CounterWidth {
Unknown,
Bits32,
Bits64,
}Expand description
The bit width of a cumulative OS counter (§8.2).
The width is what separates a wraparound from a reset. A 32-bit interface counter read on a 64-bit host jumps back to a small value roughly every 34 seconds on a saturated gigabit link; reporting each of those as a reset would blank the interface row almost continuously. When the width is genuinely unknown there is no evidence to tell wrap from reset apart, so the conservative answer applies: report a reset and re-baseline.
Variants§
Unknown
The width is not known, so every backwards move is treated as a reset.
The default, because guessing a width and guessing wrong fabricates traffic that never happened.
Bits32
A 32-bit counter, such as a legacy ifTable-style interface counter or a
32-bit device register widened to u64 by the caller.
Bits64
A 64-bit counter, such as Linux /proc/net/dev on a 64-bit kernel.
Included for completeness: at 100 Gbit/s a 64-bit byte counter takes
over forty years to wrap, so in practice this behaves like
CounterWidth::Unknown apart from rejecting absurd backwards jumps.
Implementations§
Trait Implementations§
Source§impl Clone for CounterWidth
impl Clone for CounterWidth
Source§fn clone(&self) -> CounterWidth
fn clone(&self) -> CounterWidth
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more