Conversation
- 修复 #37:Linux 下 df 遇到 FUSE 挂载点(如 /run/user/1000/doc)权限不足 时不再整体失败,只要 stdout 有有效数据即正常返回其余磁盘信息 - 解决 #39:CPUConfig 新增 excludeIowait 选项(默认 false 保持现有行为), 设为 true 时从 overall 使用率中剔除 iowait,适合 I/O 密集型场景 - 补充对应单元测试(linux-adapter: 4 个,cpu-monitor: 4 个) - 同步更新 README.md 与 README-zh.md Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
Linux 桌面环境(GNOME/KDE)中,
/run/user/1000/doc等 FUSE虚拟挂载点在非 root 权限下会导致
df命令以 exit code 1退出,进而使磁盘监控功能整体失败(#37)。
CPU 使用率在 I/O 密集型场景下存在虚高问题:iowait 期间 CPU
实际处于空闲状态,但被计入 overall 使用率,与
top等工具的展示口径不一致(#39)。
Key Changes
LinuxAdapter.getDiskInfo()/getDiskUsage():当df有有效 stdout 输出时,不再强依赖 exit code 为
0,权限错误仅影响对应挂载点,不阻断整体磁盘数据返回
CPUConfig新增excludeIowait?: boolean(默认false),CPUMonitor.transformCPUUsage()在该选项启用时从overall中减去iowait,iowait字段本身不受影响src/adapters/linux-adapter.ts、src/monitors/c pu-monitor.ts、src/types/config.tsdf容错逻辑仅在 stdout 行数 ≥ 2时生效,完全失败场景仍正常抛出
MonitorError,无回归风险Test Matrix
npm run buildnpm run test:unitnpm run test:linux / windows(if applicable)npm run lint:checkRelated Issues
Platform & Permissions
df权限容错仅对 Linux 生效,macOS / Windows 不涉及excludeIowait仅在 Linux 采样数据中有意义(macOS / Windows适配器不返回 iowait 字段,设置后无副作用)
Documentation
README.md/README-zh.md:全局配置示例补充excludeIowait,CPU 监控器章节新增配置项说明表格及代码示例Additional Notes
excludeIowait默认false,完全向后兼容,现有用户无需任何改动配额),该问题复杂度较高,建议单独排期