← 返回 Skills 市场
175
总下载
0
收藏
0
当前安装
3
版本数
在 OpenClaw 中安装
/install gateway-restart-profiler
功能描述
OpenClaw Gateway 重启性能分析工具。分析 Gateway 重启速度、排查启动慢的原因、生成性能报告、诊断启动问题。支持 Windows (PowerShell) 和 Linux (Bash) 平台。触发场景包括:分析 gateway 重启、检查启动时间、gateway 太慢了、生成性能报告、诊断...
使用说明 (SKILL.md)
Gateway Restart Profiler
分析 OpenClaw Gateway 重启时的各阶段耗时,生成性能报告并给出优化建议。
支持平台
- Windows: PowerShell 5.0+
- Linux: Bash 4.0+, 需安装
bc计算器
使用方法
Windows
powershell -ExecutionPolicy Bypass -File \x3Cskill>/scripts/gateway-profile.ps1
Linux
bash \x3Cskill>/scripts/gateway-profile.sh
代理调用方式
当用户要求分析 Gateway 重启性能时,OpenClaw 代理应使用以下方式调用:
Windows:
exec(command="powershell -ExecutionPolicy Bypass -File \x3Cskill>/scripts/gateway-profile.ps1", elevated=true)
Linux:
exec(command="bash \x3Cskill>/scripts/gateway-profile.sh", elevated=true)
其中 \x3Cskill> 应替换为实际路径,例如:
- Linux:
/home/tstj/.openclaw/workspace/skills/gateway-restart-profiler - Windows:
C:\Users\\x3Cuser>\.openclaw\workspace\skills\gateway-restart-profiler
代理调用时会自动重启 Gateway(先 stop 再 start),监听日志解析各阶段耗时,生成 HTML 可视化报告和文本摘要。
输出内容
- 实时日志监控 - 高亮显示各启动阶段
- HTML 可视化报告 - Chart.js 图表(柱状图 + 饼图)
- 详细数据表 - 含耗时百分比和可视化进度条
- 优化建议 - 自动识别超过30秒的阶段并给出建议
- 文本摘要 - 保存到 temp 目录
分析的阶段
| 阶段 | 说明 |
|---|---|
| 配置加载 | 读取 openclaw.json |
| 身份验证 | 连接认证服务 |
| HTTP服务 | 启动 Web 服务 |
| Canvas | Canvas 挂载 |
| MCP服务 | MCP 协议服务 |
| 心跳服务 | 心跳监控 |
| 模型加载 | 加载 AI 模型 |
| 频道启动 | 启动 QQ/Telegram 等频道 |
| 插件系统 | 加载插件 |
优化建议解读
| 阶段耗时 | 可能原因 |
|---|---|
| 配置加载 > 30s | 配置文件过大或损坏 |
| 身份验证 > 30s | 网络问题或认证服务故障 |
| 模型加载 > 30s | Ollama 响应慢,建议换用 API 模式 |
| 频道启动 > 30s | QQ/Telegram 连接异常 |
| 插件系统 > 30s | npm 依赖缺失,需重新安装 |
日志文件位置
- Windows:
C:\Users\\x3Cuser>\AppData\Local\Temp\openclaw\ - Linux:
~/.openclaw/logs/
示例输出
HTML 报告(用浏览器打开)包含:
- 📊 耗时分布饼图 - 各阶段占总耗时比例
- 📈 横向柱状图 - 按耗时排序,一目了然
- 📋 详细数据表 - 毫秒/秒/占比/可视化进度条
- 💡 优化建议 - 超过30秒的阶段高亮提示
控制台同时输出:
阶段耗时明细 (按耗时降序):
频道启动 45000ms (45s) ########################
模型加载 32000ms (32s) ################
配置加载 12000ms (12s) #########
优化建议:
- [频道启动] 检查QQ/Telegram连接是否正常
- [模型加载] Ollama响应慢,考虑换用API模式
[HTML图表报告已保存: ~/.openclaw/logs/gateway-profile-2026-04-12.html]
→ 用浏览器打开 HTML 文件查看可视化图表!
安全使用建议
Before installing or running this skill: 1) Understand that it will stop and start your Gateway and requires elevated (admin/root) execution — schedule downtime or run in a test environment. 2) Verify the presence and origin of the 'openclaw' CLI on the host (the script calls 'openclaw gateway stop/start' but the skill does not declare this dependency). 3) Note the SKILL.md mentions a Windows PowerShell script that is not included; do not assume Windows support is present. 4) Review the included shell script yourself (it is present) to confirm it does only the expected log parsing and report generation; it does not appear to exfiltrate data, but it does load Chart.js from a CDN in the HTML report. 5) If you require stricter isolation, run the script manually in a safe environment (or on a staging Gateway) rather than granting an agent autonomous elevated execution. If you want me to, I can point out exact lines in the shell script that perform sensitive actions or suggest a safer invocation approach.
功能分析
Type: OpenClaw Skill
Name: gateway-restart-profiler
Version: 0.1.2
The skill is a performance profiling tool designed to analyze the restart sequence of the OpenClaw Gateway. It functions by stopping and starting the gateway service, monitoring log files (gateway-profile.sh), calculating the duration of various initialization stages, and generating both text and visual HTML reports using Chart.js. While the skill requests elevated privileges to manage the gateway service, its operations are transparent, well-documented, and strictly limited to the stated purpose of performance diagnostics without any indicators of data exfiltration, persistence, or malicious command execution.
能力评估
Purpose & Capability
The skill claims to profile Gateway restarts and the included Linux script does exactly that (stop/start gateway, tail logs, compute phase timings, output HTML/text reports). However, the SKILL.md references a Windows PowerShell script (gateway-profile.ps1) that is not present in the file manifest, and the instructions require running the 'openclaw' CLI (openclaw gateway stop/start) although required binaries lists none — the skill omits declaring a real dependency on the openclaw binary.
Instruction Scope
Instructions direct the agent to stop and start the Gateway and parse local log files under ~/.openclaw/logs or /tmp, which is within the stated purpose. They also explicitly request the agent run the commands elevated=true (admin/root). The script reads only local logs and writes reports to ~/.openclaw/logs and /tmp; it does not contain obvious external data exfiltration, but it does load Chart.js from a CDN for the HTML report.
Install Mechanism
No install spec or external downloads are used; the skill is instruction-only plus a shell script. This minimizes installation risk because no third-party archive is fetched or executed at install time.
Credentials
The skill declares no required environment variables or credentials, which is appropriate. The script only accesses local log paths and writes reports under the user's home/temp directories; no secrets or unrelated credentials are requested.
Persistence & Privilege
The SKILL.md instructs the agent to execute the profiling scripts with elevated privileges (elevated=true) and to stop/start the Gateway. Running with elevation is a significant privilege and will interrupt service; while this may be necessary to manage the Gateway, it increases risk and should be accepted explicitly by the user and run in a controlled window. The skill does not request persistent installation (always: false).
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install gateway-restart-profiler - 安装完成后,直接呼叫该 Skill 的名称或使用
/gateway-restart-profiler触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.1.2
补充 Windows 脚本调用说明,修复 SKILL.md 与实际包内容不一致的问题
v0.1.1
更新描述,增加 SEO 关键词
v0.1.0
首次发布 - OpenClaw Gateway 重启性能分析工具
元数据
常见问题
Gateway Restart Profiler 是什么?
OpenClaw Gateway 重启性能分析工具。分析 Gateway 重启速度、排查启动慢的原因、生成性能报告、诊断启动问题。支持 Windows (PowerShell) 和 Linux (Bash) 平台。触发场景包括:分析 gateway 重启、检查启动时间、gateway 太慢了、生成性能报告、诊断... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 175 次。
如何安装 Gateway Restart Profiler?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install gateway-restart-profiler」即可一键安装,无需额外配置。
Gateway Restart Profiler 是免费的吗?
是的,Gateway Restart Profiler 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Gateway Restart Profiler 支持哪些平台?
Gateway Restart Profiler 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Gateway Restart Profiler?
由 tstj007(@tstj007)开发并维护,当前版本 v0.1.2。
推荐 Skills