oa::LogMetrics

Structured JSONL scalar-metrics sink. Thread-safe: log_scalar and flush serialize through an internal mutex. The open flag is an atomic for cheap is_open checks on the hot path.

StRust public API

Declaration

pub struct LogMetrics { /* private fields */ }
Public Rust declaration.

Public Methods

pub fn open(&mut self, dir: &Path) -> Result<()>
pub fn is_open(&self) -> bool
pub fn log_dir(&self) -> String
pub fn log_scalar(&self, tag: &str, step: i64, value: f64)
pub fn log_scalars( &self, base_tag: &str, step: i64, values: &HashMap<String, f64>, )
pub fn flush(&self) -> Result<()>
pub fn close(&self) -> Result<()>
pub fn set_flush_interval(&self, n: usize)
fn drop(&mut self)

Associated Functions

pub fn new() -> Self
fn default() -> Self

Public Method Documentation

pub fn open(&mut self, dir: &Path) -> Result<()>
No public source comment is attached to this declaration.
pub fn is_open( &self ) -> bool
No public source comment is attached to this declaration.
pub fn log_dir( &self ) -> String
No public source comment is attached to this declaration.
pub fn log_scalar( &self, tag: &str, step: i64, value: f64 )
No public source comment is attached to this declaration.
pub fn log_scalars( &self, base_tag: &str, step: i64, values: &HashMap<String, f64> )
No public source comment is attached to this declaration.
pub fn flush(&self) -> Result<()>
No public source comment is attached to this declaration.
pub fn close(&self) -> Result<()>
No public source comment is attached to this declaration.
pub fn set_flush_interval( &self, n: usize )
No public source comment is attached to this declaration.
fn drop( &mut self )
No public source comment is attached to this declaration.
pub fn new() -> Self
No public source comment is attached to this declaration.
fn default() -> Self
No public source comment is attached to this declaration.