pub struct SlowLogConfig {
pub enabled: bool,
pub threshold: String,
pub path: Option<String>,
pub max_size: Option<String>,
}Expand description
Slow-query log configuration (P5 / #16). Default off — recording
every slow query to a side file is opinionated enough to warrant an
explicit opt-in. When enabled, the HistoryDb::record hook also
appends a tab-separated line to path for every run whose
duration_ms >= threshold_ms.
max_size (#55) caps the slow-log file: before a tee write that
would push the file past the cap, the existing log is rotated to
<path>.1 (a single archive — a second rotation overwrites it) and
a fresh empty log is started. None (the default) disables rotation
so the log grows unbounded.
Fields§
§enabled: bool§threshold: StringThreshold expressed as humantime (e.g. "1s", "250ms",
"2m"). The CLI also accepts a bare integer of milliseconds.
path: Option<String>Append target. When None, defaults to
<XDG_DATA_HOME>/ferrule/slow.log.
max_size: Option<String>Maximum slow-log file size before single-archive rotation, as a
byte-size string ("10MB", "5MiB", or a bare integer of
bytes). None disables rotation. See Self::max_size_bytes.
Implementations§
Source§impl SlowLogConfig
impl SlowLogConfig
Sourcepub fn threshold_ms(&self) -> Result<u64, String>
pub fn threshold_ms(&self) -> Result<u64, String>
Resolve threshold to a millisecond count. Accepts a bare integer
("500" → 500ms) or any humantime-style duration string. Returns
Err with a clear message on bad input.
Trait Implementations§
Source§impl Clone for SlowLogConfig
impl Clone for SlowLogConfig
Source§fn clone(&self) -> SlowLogConfig
fn clone(&self) -> SlowLogConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more