Expand description
Resource limit detection and threshold checking for large repos.
This module provides platform-specific detection of file watching limits and generates warnings when thresholds are exceeded.
Structs§
- Diff
Metrics - Metrics collected during diff computation.
- Diff
Thresholds - Thresholds for diff processing warnings.
- Watcher
Metrics - Metrics collected during file watcher setup. Only meaningful on Linux where we watch directories individually.
Functions§
- check_
watch_ warning - Check if watch metrics exceed thresholds and return a warning message. On macOS/Windows with recursive watching, this is never called.
- get_
watch_ limit - Get the recommended watch limit for Linux. Uses 50% of the inotify limit since it’s shared across all user applications. Returns None on WSL (which uses PollWatcher with no limit).
- is_wsl
- Detect if running under Windows Subsystem for Linux. WSL’s inotify implementation is unreliable, so we use polling instead.
- parse_
inotify_ value - Parse an inotify sysctl value from its string representation. Returns None if the string is empty or not a valid number.