Skip to main content

Module disk_space_monitor

Module disk_space_monitor 

Source
Expand description

DiskSpaceMonitor — edge-triggered disk space watchdog.

Linux: opens a fanotify group watching FAN_CLOSE_WRITE on the data directory’s mount point. Every write event triggers a statvfs check; if used% ≥ threshold and the debounce window has cleared, emits OperatorEvent::DiskSpaceCritical. Falls back to polling when fanotify_init returns EPERM (unprivileged container).

Non-Linux: polls via a tokio timer at POLL_INTERVAL.

Structs§

DiskSpaceMonitor
Background disk-space watchdog. Spawn with DiskSpaceMonitor::spawn.