← Back to Skills Marketplace
tstj007

Gateway Restart Profiler

by tstj007 · GitHub ↗ · v0.1.2 · MIT-0
cross-platform ⚠ suspicious
175
Downloads
0
Stars
0
Active Installs
3
Versions
Install in OpenClaw
/install gateway-restart-profiler
Description
OpenClaw Gateway 重启性能分析工具。分析 Gateway 重启速度、排查启动慢的原因、生成性能报告、诊断启动问题。支持 Windows (PowerShell) 和 Linux (Bash) 平台。触发场景包括:分析 gateway 重启、检查启动时间、gateway 太慢了、生成性能报告、诊断...
README (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 可视化报告和文本摘要。

输出内容

  1. 实时日志监控 - 高亮显示各启动阶段
  2. HTML 可视化报告 - Chart.js 图表(柱状图 + 饼图)
  3. 详细数据表 - 含耗时百分比和可视化进度条
  4. 优化建议 - 自动识别超过30秒的阶段并给出建议
  5. 文本摘要 - 保存到 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 文件查看可视化图表!
Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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).
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install gateway-restart-profiler
  3. After installation, invoke the skill by name or use /gateway-restart-profiler
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v0.1.2
补充 Windows 脚本调用说明,修复 SKILL.md 与实际包内容不一致的问题
v0.1.1
更新描述,增加 SEO 关键词
v0.1.0
首次发布 - OpenClaw Gateway 重启性能分析工具
Metadata
Slug gateway-restart-profiler
Version 0.1.2
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 3
Frequently Asked Questions

What is Gateway Restart Profiler?

OpenClaw Gateway 重启性能分析工具。分析 Gateway 重启速度、排查启动慢的原因、生成性能报告、诊断启动问题。支持 Windows (PowerShell) 和 Linux (Bash) 平台。触发场景包括:分析 gateway 重启、检查启动时间、gateway 太慢了、生成性能报告、诊断... It is an AI Agent Skill for Claude Code / OpenClaw, with 175 downloads so far.

How do I install Gateway Restart Profiler?

Run "/install gateway-restart-profiler" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Gateway Restart Profiler free?

Yes, Gateway Restart Profiler is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Gateway Restart Profiler support?

Gateway Restart Profiler is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Gateway Restart Profiler?

It is built and maintained by tstj007 (@tstj007); the current version is v0.1.2.

💬 Comments