pub struct KqueueEventsConfig {
pub num_file_watchers: usize,
pub num_timers: usize,
pub num_sockets: usize,
pub timeout_ms: u32,
}Expand description
Configuration for kqueue events entropy collection.
§Example
let config = KqueueEventsConfig {
num_file_watchers: 2, // fewer watchers
num_timers: 16, // more timers for richer interference
num_sockets: 4, // default socket pairs
timeout_ms: 2, // slightly longer timeout
};Fields§
§num_file_watchers: usizeNumber of file watchers to register via EVFILT_VNODE.
Each watcher monitors a temp file for write/attribute changes. The filesystem notification path traverses VFS, APFS/HFS event queues, and the kqueue knote hash table.
Range: 0+. Default: 4
num_timers: usizeNumber of timer events to register via EVFILT_TIMER.
Each timer fires at a different interval (1-10ms). Multiple timers create scheduling contention and exercise kernel timer coalescing. Timer delivery is affected by interrupt handling and power management.
Range: 0+. Default: 8
num_sockets: usizeNumber of socket pairs for EVFILT_READ/EVFILT_WRITE monitoring.
Socket buffer management interacts with the network stack’s mbuf allocator. A background thread periodically writes to sockets to generate asynchronous events.
Range: 0+. Default: 4
timeout_ms: u32Timeout in milliseconds for kevent() calls.
Controls how long each kevent() waits for events. Shorter timeouts
capture more frequent timing samples; longer timeouts allow more
events to accumulate per call.
Range: 1+. Default: 1
Trait Implementations§
Source§impl Clone for KqueueEventsConfig
impl Clone for KqueueEventsConfig
Source§fn clone(&self) -> KqueueEventsConfig
fn clone(&self) -> KqueueEventsConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more