#[non_exhaustive]pub struct WatcherStats {
pub requeries: u64,
pub changes: u64,
pub skipped: u64,
pub retries: u64,
pub recoveries: u64,
pub terminal_failures: u64,
pub last_error: Option<WatcherErrorKind>,
pub watch_errors: u64,
}Expand description
A cheap point-in-time copy of the watcher’s health counters — see
RepoWatcher::stats. Lets a long-running consumer notice a watcher that is
silently skipping re-queries (e.g. a permanently wedged repository) instead
of inferring health from event silence.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.requeries: u64Re-query attempts started, including automatic retry attempts.
changes: u64Re-queries that emitted a RepoChange (the rest found no difference).
skipped: u64Re-queries skipped — transient query failures plus deadline overruns.
retries: u64Automatic re-query retries scheduled after transient failures/timeouts.
recoveries: u64Failed re-query sequences that later succeeded during automatic retry.
terminal_failures: u64Terminal filesystem-watch backend failures. When this increments, the
output channel is closed and RepoWatcher::recv returns None.
last_error: Option<WatcherErrorKind>What the most recent skip failed on; None when nothing was ever skipped.
watch_errors: u64Filesystem-watch errors reported by the OS backend (via notify). A
non-zero — especially climbing — count means the underlying watch is
failing: most often the watched .git/.jj directory was removed and
re-created (a re-clone / jj git init), which invalidates the OS watch on
the old directory. Such a reported error terminates the watch: recv
returns None (and the stream ends), so the consumer can rebuild it.
Best-effort, platform-dependent. It is reliable on Windows, where
removing the watched directory fails ReadDirectoryChangesW and notify
reports an error. On Linux (inotify) a removed/re-created directory may
surface as an ordinary event or a silent watch teardown rather than an error,
so watch_errors can stay 0 even as the watcher goes deaf — don’t rely on
it as the sole liveness signal there.
Trait Implementations§
Source§impl Clone for WatcherStats
impl Clone for WatcherStats
Source§fn clone(&self) -> WatcherStats
fn clone(&self) -> WatcherStats
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more