DSH 侧栏的 Windows 资源监控:每 60 秒采集 CPU、内存与主频,保留 30 天历史,CPU 与内存各一张 24 小时 / 7 天独立曲线(带 85% / 90% 告警线),另有一张频率曲线标注有负载时的降频,并判定 CPU 持续 ≥ 85%(10 分钟)、内存持续 ≥ 90%(10 分钟)、有负载时频率 ≤ 最高频率 70%(5 分钟)三类异常。
安装
# Release 预构建包
dsh plugin --profile web add "https://github.com/XiaoLuoMin/dsh-resource-monitor/releases/latest/download/dsh-resource-monitor.tgz"
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:XiaoLuoMin/dsh-resource-monitor
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED 或 ERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yaml 的 allowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。
README
A DeepSeek Harness (dsh) sidebar plugin that samples your Windows machine once a minute, keeps a 30-day history, and tells you when sustained CPU load, memory pressure, or frequency throttling actually happened — instead of showing a live gauge you have to stare at.
DSH 侧栏插件:每分钟采集一次本机资源,保留 30 天历史,直接用「连续多久超阈值」判定长期高占用、内存吃紧与降频,而不是只给一个需要一直盯着看的实时仪表盘。
What it does / 功能
- Sidebar tab 资源监控; a matching entry button also sits in the session title bar. / 侧栏 tab「资源监控」,会话标题栏也有入口按钮。
- Panel order: KPI row, conclusion box, CPU chart (85% alert line), memory chart (90% alert line), frequency chart (70% throttle line), incident list. / 面板顺序:KPI、结论框、CPU 曲线(85% 告警线)、内存曲线(90% 告警线)、频率曲线(70% 降频线)、异常列表。
- KPI row: current CPU, current memory (used / total GB), current frequency. / KPI:当前 CPU、当前内存(已用/总量 GB)、当前频率。
- Summary: range average/peak, minutes spent at ≥85% CPU, minutes at ≥90% memory, throttled minutes. / 结论:区间平均/峰值、超阈值累计分钟、降频分钟。
- Incident list (last 7 days): CPU sustained load, memory near capacity, frequency held down under load. / 异常列表(近 7 天):CPU 长时间高占用、内存接近上限、负载下降频。
- 24h / 7d toggle, auto-refresh every 30 s. / 24 小时 / 7 天切换,30 秒自动刷新。
Detection rules / 判定规则
| Item / 项目 | Rule / 规则 |
|---|---|
| Sample interval / 采样间隔 | 60 s |
| Retention / 历史保留 | 30 days (samples.jsonl, append-only) |
| CPU alert | ≥ 85% for ≥ 10 consecutive minutes |
| Memory alert | ≥ 90% for ≥ 10 consecutive minutes |
| Throttle alert | CPU ≥ 50% while frequency ≤ 70% of maximum, for ≥ 5 consecutive minutes |
Data sources / 数据来源
- CPU / memory: Node
os.cpus()time deltas,os.totalmem()/os.freemem(). - Frequency: Windows performance counter
\Processor Information(_Total)\% of Maximum Frequency. - Disk:
\PhysicalDisk(_Total)\Disk Read Bytes/sec,Disk Write Bytes/sec(still sampled into the history, not charted). / 磁盘读写仍写入历史,但不再绘图。 - Network:
Get-NetAdapterStatisticscumulative bytes, converted to a rate between two samples (history only, not charted). / 网络同样只入库不绘图。 - Disk and network figures come from one
powershell.exechild process per sample (~2–4 s, async, never blocks the UI).
No temperature readings / 不采集温度
Reading CPU core temperature on Windows (MSR / SMBus) needs a kernel driver. This plugin does not ship or load one; it deliberately infers throttling from the frequency / maximum-frequency ratio, which reflects the throttling event itself and needs no driver or elevation.
Windows 上读取 CPU 核心温度需要内核驱动。本插件不附带、也不加载任何驱动,改用「当前频率 / 最高频率」判定降频 —— 这个信号直接反映降频事实,且不需要驱动或提权。
Install / 安装
dsh plugin --profile desktop add github:XiaoLuoMin/dsh-resource-monitor
Then restart the DSH app so both the host and the client half load. / 装完重启 DSH 应用(host 与 client 两半都要重新加载)。
Uninstall / 卸载:
dsh plugin --profile desktop remove dsh-resource-monitor
Data location / 数据位置
%USERPROFILE%\.dsh\data\resource-monitor\samples.jsonl
One JSON object per line, one line per minute. Delete the file to reset the history. / 每行一个 JSON 样本,每分钟一行;删除该文件即清空历史。
Layout / 结构
lib/index.js host: sampling loop, 30-day history, POST /api/resource-monitor.snapshot
client/client.js client: sidebar tab, entry button, separate CPU / memory / frequency canvas charts, summary and incident list
cordis.patch.yml bundle insert declaration
License
MIT — see LICENSE.
Changelog / 版本记录
- 1.1.2 — 结论框移到 CPU 曲线之上;面板顺序:KPI → 结论 → CPU → 内存 → 频率 → 事件。
- 1.1.1 — CPU 与内存拆成两张独立曲线(各带 85% / 90% 告警线),移除磁盘与网络曲线。
- 1.1.0 — 插件更名为 dsh-resource-monitor(原 dsh-resource-alerts)。
- 1.0.2 — 修复结论行的重复百分号;频率卡片增加 CPU 叠加线与 70% 降频基准线。
- 1.0.1 — 修复 exports 缺少根入口导致 DSH 无法导入。
链接
同类插件
zhu1090093659/dsh-web#packages/dsh-task-board★ 9925
侧边栏多列任务看板:卡片交给真实 DSH 智能体会话执行,支持 cron 定时(Host 侧到点执行,关浏览器也生效)。
zhu1090093659/dsh-web#packages/dsh-web-all★ 9925
DSH Web UI 插件与皮肤合集:任务看板、git 图、右侧面板、远程移动端 UI、桌宠、实时 token 统计与皮肤中心。
MeteorNOX/DeepSeek-Balance-Whale-Widget★ 6712
右下角常驻的小鲸鱼挂件:余额、今日已用与每轮对话消耗(含峰谷价),余额预警与今日预算的泡泡内容都可编辑;泡泡点击序列模块化自定义,支持并列加权 A/B、随机台词与随机图片;内置 30+ 厂商模板(OpenAI / OpenRouter / Kimi / 硅基流动 / 方舟 / 智谱 / MiniMax 等),按模型查余额与订阅额度;另有任务结束音效、导入音频、自定义角色与资源管理。数据全在本机,无遥测。
ccch1mneyyy/dsh-TUI★ 6538
Claude Code 风格全屏终端 UI:像素鲸鱼顶栏、实时工作状态行、思考流式展开。
omdsh-dev/DSH-better-sidebar★ 4808
侧边栏完整工作台:内置文件渲染编辑、终端、Git 与子代理,支持三方插件注册新 Tab。
Devin-AXIS/deepseek-design#deepseek-idesign★ 1672
可视化设计工作室,支持网站、App 原型、海报、信息卡、报告和杂志的模板创建、元素编辑、选区级 AI 草稿衔接与导出。
社区评论
评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。