Files
Nexus/docs/audit/2026-07-02-agent-cpu-sampling.md
T
r 6859846b7c sync: 主项目全量同步(含 btpanel 一键登录回归修复与前端构建产物)
- bootstrap 失败恢复 SSH 临时登录回退
- ssh_bootstrap 真安装检测与 config 目录自愈
- axs Gitea 发布源切换为 https://axs.kuma1xn.vip
2026-07-08 23:52:40 +08:00

1.0 KiB

审计 — Agent 2.1.1 CPU 采样

Changelog: docs/changelog/2026-07-02-agent-cpu-sampling.md

Step 3 规则扫描

文件 规则 结论
cpu_metrics.py watch 首次 1s bootstrap,后续 interval=None 对齐 ~5s 心跳 PASS
agent.py 进入 watch 时 reset_watch_cpu_bootstrap() PASS
server_batch_common 升级命令含 cpu_metrics.py PASS
常态 60s 心跳 仍用 sample_cpu_percent(watch_mode=False) PASS

Closure

状态
CPU 曲线长期 0% 监测模式改长窗口采样
双模心跳 不变,仍 5s/60s
旧 Agent 2.1.0 可继续用,仅 CPU 显示偏 0

文件清单

  • web/agent/cpu_metrics.py
  • web/agent/agent.py
  • server/application/server_batch_common.py
  • tests/test_agent_cpu_metrics.py

DoD

  • pytest cpu_metrics + watch_mode 通过
  • AGENT_VERSION 2.1.1
  • 升级脚本拉取 cpu_metrics.py

验证

.venv/bin/pytest tests/test_agent_cpu_metrics.py tests/test_agent_watch_mode.py -q