rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:ruozhi5067/dsh-plugin-performance
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
DSH(DeepSeek Harness)侧边栏的实时性能表:一个全局面板,同时展示整机与 DSH 自身进程树的 CPU / GPU / 内存 / 网络 / 磁盘占用。
面板打开才采样,关闭 15 秒后采样器自动退出——闲置时 CPU 与内存占用归零。

| 资源 | 系统(整机) | DSH(本应用进程树) |
|---|---|---|
| CPU | 总占用 % / 逻辑核数 | 进程树合计 CPU % / 进程数 |
| GPU | GPU 引擎占用 % / 显存 | 进程树 GPU % / 显存 |
| 内存 | 已用 / 总量(%) | 进程树内存合计 / 占系统比例 |
| 网络 | 全机 ↓ / ↑ 速率 | Host 进程外网 ↓ / ↑ 速率 |
| 磁盘 | 各分区占用 % + 磁盘活动 % + 读/写速率 | 进程树磁盘 I/O 读/写速率 |
GET /dsh-perf-table/snapshot 时才启动采样器。PdhAddEnglishCounterW,规避中文系统计数器本地化),单次 collect 仅数毫秒,自身 CPU 目标 < 1% 单核;不使用昂贵的 WMI / CIM Win32_Perf* 查询。\Process(*) 通配查询的重名歧义与开销。dsh-host-webserver 服务;开发验证于 DSH 0.2.2-rc.1);-NoProfile -NonInteractive -ExecutionPolicy Bypass 运行临时脚本,进程退出即结束)。本仓库的包名是 dsh-perf-table(package.json 中已带 dsh.bundle.patch,可独立作为组合包安装)。
把本仓库目录放到任意位置(下称 <REPO>);
在 DSH profile(如 ~/.dsh/profiles/<profile>)的 package.json 的 dependencies 中追加:
{
"dependencies": {
"dsh-perf-table": "link:<REPO>"
}
}
在 dsh.profile.bundles 中追加 "dsh-perf-table":
{
"dsh": {
"profile": {
"bundles": ["@deepseek-ai/dsh-base", "...", "dsh-perf-table"]
}
}
}
在 profile 目录执行 pnpm install(或 npm install)建立链接;
重启 DSH(菜单「重启应用和 Host」)。新插件需要重启后才会加载。
DSH Desktop 的 desktop profile 由应用独占管理,
dsh plugin --profile desktop add ...可能被拒绝;此时按上面的方式手工登记依赖与 bundle 即可。
完成方式 A 的第 1、2、4 步(登记依赖并建立链接);
编辑 profile 的 cordis.patch.yml(用户补丁层),追加:
- insert:
- id: perf-table
name: dsh-perf-table
重启 DSH。
方式 A 与方式 B 二选一,不要同时使用(否则同一个 Loader 行会被插入两次)。
浏览器(client.js) DSH Host(index.js) 系统
┌─────────────────────┐ GET ┌────────────────────────┐ spawn ┌──────────────────────┐
│ 侧栏图标 + 性能表面板 │ ────────► │ /dsh-perf-table/snapshot│ ────────► │ sampler.ps1 │
│ 每 1500ms 轮询一次 │ ◄──────── │ 内存缓存最近一次采样 │ ◄──────── │ PowerShell 5.1 + PDH │
└─────────────────────┘ JSON └────────────────────────┘ 逐行 JSON └──────────────────────┘
index.js(Host 半边):采样器守护(启动 / 看门狗 / 崩溃重启 / 空闲退出)、Host 出向网络打点、只读快照路由;sampler.ps1(长驻采样器):PowerShell 5.1 + 内联 C#,通过 PDH 英文计数器采集系统 CPU / GPU / 磁盘 / 网络,通过 Win32 API 采集进程树指标,每 1500ms 向 stdout 输出一行紧凑 JSON;client.js(浏览器半边):侧栏入口 + 全局面板;轮询快照、渲染「系统 / DSH」两行与进程明细;面板不可见或页面隐藏时停止轮询。GlobalMemoryStatusEx;分区空间:System.IO.DriveInfo;net.Socket 打点(已过滤 127.0.0.1 / ::1 回环流量),只统计 DSH 后端真正对外发起的连接;dsh.profile.bundles 中移除 dsh-perf-table(或删除用户补丁层的 perf-table 行);package.json 中删除依赖,并移除 node_modules 链接;卸载后不会残留进程、路由或全局样式。
dsh-plugin-performance/
├─ index.js # Host 半边:采样器守护、网络打点、快照路由
├─ sampler.ps1 # Windows PDH 长驻采样器(逐行 JSON)
├─ client.js # 浏览器半边:侧栏图标 + 性能表全局面板
├─ cordis.patch.yml # 组合包补丁:插入 perf-table 行
├─ locale/*.json # 插件页标题 / 描述(中英)
├─ icon.svg # 插件图标
└─ preview/ # README 截图
node --check index.js
node --check client.js
# 直接运行采样器(需 Windows PowerShell 5.1;RootPid 可填任意进程 PID 做冒烟测试)
powershell.exe -NoProfile -NonInteractive -ExecutionPolicy Bypass -File sampler.ps1 -RootPid 1 -IntervalMs 1500
采样器的详细设计(PDH 选择、进程树枚举、错误降级)写在 sampler.ps1 文件头注释中。
MIT © 2026 ruozhi5067
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek、deepseek-harness。