ring_file/
lib.rs

1//! # RingFile
2//!
3//! The purpose of this tool is to help debug deadlock problems, that only occur under
4//! high-performance scenarios. Because writing log to disk will slow down execution,
5//! which makes deadlock hidden without racing conditions met.
6//!
7//! This crate provides two abstraction:
8//!
9//! [RingBuffer]: to store byte content in memory when written.
10//! when offset rewinds, new content will overwrite old content,
11//! so that memory consumption is limited to buf_size.
12//!
13//! [RingFile]: to record log content in memory for multi-threaded program. Act as an observer to
14//! analyze concurrency problem. It maintain thread local buffer to avoid lock contention.
15//! Already integrated into [captain-log](https://docs.rs/captains-log) as `LogRingFile` sink.
16
17mod buffer;
18pub use buffer::RingBuffer;
19mod threads;
20pub use threads::RingFile;