#[repr(u8)]pub enum ObservabilityLevel {
Off = 0,
Production = 1,
Diagnostic = 2,
}Expand description
Observability collection level, configurable at runtime.
Per Doc 05, Section 1.4: three levels with explicit overhead budgets.
Transitions are atomic (via AtomicU8 in the collector).
§Examples
use torvyn_types::ObservabilityLevel;
let level = ObservabilityLevel::Production;
assert!(level.is_enabled());
assert_eq!(level as u8, 1);Variants§
Off = 0
Nothing collected. For bare-metal benchmarks. Overhead: 0%.
Production = 1
Flow-level counters, latency histograms, error counts. Default. Overhead: < 1% throughput, < 500ns per element.
Diagnostic = 2
All of Production + per-element spans, per-copy accounting, per-backpressure events, queue depth snapshots. Overhead: < 5% throughput, < 2us per element.
Implementations§
Source§impl ObservabilityLevel
impl ObservabilityLevel
Sourcepub const fn is_enabled(&self) -> bool
pub const fn is_enabled(&self) -> bool
Returns true if any collection is enabled.
§HOT PATH — checked per element to skip recording.
Sourcepub const fn is_diagnostic(&self) -> bool
pub const fn is_diagnostic(&self) -> bool
Returns true if diagnostic-level detail is enabled.
§HOT PATH — checked per element for detailed recording.
Trait Implementations§
Source§impl Clone for ObservabilityLevel
impl Clone for ObservabilityLevel
Source§fn clone(&self) -> ObservabilityLevel
fn clone(&self) -> ObservabilityLevel
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ObservabilityLevel
impl Debug for ObservabilityLevel
Source§impl Default for ObservabilityLevel
impl Default for ObservabilityLevel
Source§fn default() -> ObservabilityLevel
fn default() -> ObservabilityLevel
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ObservabilityLevel
impl<'de> Deserialize<'de> for ObservabilityLevel
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for ObservabilityLevel
impl Display for ObservabilityLevel
Source§impl Hash for ObservabilityLevel
impl Hash for ObservabilityLevel
Source§impl Ord for ObservabilityLevel
impl Ord for ObservabilityLevel
Source§fn cmp(&self, other: &ObservabilityLevel) -> Ordering
fn cmp(&self, other: &ObservabilityLevel) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for ObservabilityLevel
impl PartialEq for ObservabilityLevel
Source§impl PartialOrd for ObservabilityLevel
impl PartialOrd for ObservabilityLevel
Source§impl Serialize for ObservabilityLevel
impl Serialize for ObservabilityLevel
impl Copy for ObservabilityLevel
impl Eq for ObservabilityLevel
impl StructuralPartialEq for ObservabilityLevel
Auto Trait Implementations§
impl Freeze for ObservabilityLevel
impl RefUnwindSafe for ObservabilityLevel
impl Send for ObservabilityLevel
impl Sync for ObservabilityLevel
impl Unpin for ObservabilityLevel
impl UnwindSafe for ObservabilityLevel
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