pub struct JsonlEventSink { /* private fields */ }Expand description
Writes every event as one JSON line to events.jsonl, teeing
metric-bearing events (TrialMetric, MetricReported) into a flat
metrics.jsonl for cheap time-series reads.
Writes are buffered and flushed every flush_every events (and on
[EventSink::flush]/drop). I/O errors are logged and swallowed —
tracking must never take down a training run.
Implementations§
Source§impl JsonlEventSink
impl JsonlEventSink
Sourcepub fn create(
events_path: &Path,
metrics_path: Option<&Path>,
flush_every: usize,
) -> Result<Self>
pub fn create( events_path: &Path, metrics_path: Option<&Path>, flush_every: usize, ) -> Result<Self>
Create fresh log files (truncating any existing ones).
Trait Implementations§
Source§impl Drop for JsonlEventSink
impl Drop for JsonlEventSink
Auto Trait Implementations§
impl !Freeze for JsonlEventSink
impl RefUnwindSafe for JsonlEventSink
impl Send for JsonlEventSink
impl Sync for JsonlEventSink
impl Unpin for JsonlEventSink
impl UnsafeUnpin for JsonlEventSink
impl UnwindSafe for JsonlEventSink
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