← 返回 CLI 目录
Vegeta
$ vegeta 社区开源 中风险 Tomás Senart (tsenart) · 浏览器与网页抓取 · MIT · macos / linux / windows
Vegeta 是围绕 Unix 管道设计的 Go HTTP 压测工具:vegeta attack 输出二进制采样流,配合 vegeta report -type=json 或 vegeta encode -to=json 即可生成精确的延迟分位与错误统计。
FCRS-1.0 综合评分
87 /100
良好 (Good)
中置信度 (源码/文档)
零摩擦安装命令
brew install vegeta CLI vs MCP 选型建议 仅 CLI 可用
在 Shell 管道中通过 attack | report -type=json 做恒定 QPS 回归验证极为契合,无需 MCP。
Agent 友好度体检单
✓ 原生 JSON 输出
— 字段裁剪
✓ 无头非交互
— 支持 Dry-Run
— 只读模式开关
✓ 支持 NO_COLOR
— 自省/Schema 发现
— 官方 SKILL.md
当前为静态评估(本机尚未安装或尚未运行探针)。可在本地运行 npm run data:probe 并提交 data/probes/ 升级为实测证据。
FCRS-1.0 六维评分拆解
Agent 友好度 21 / 25
非交互式 Unix 管道设计,支持 vegeta report -type=json 与 vegeta encode -to=json,但未传 -duration 会无限运行且 attack 默认输出二进制流。
- Supports
vegeta report -type=jsonandvegeta encode -to=json
安全与权限边界 20 / 25
恒定发包速率可避免突发流量冲击,但务必设置 -duration 防止无限循环。
- Requires explicit
-durationto bound execution
安装与运行摩擦 15 / 15
单文件静态 Go 二进制,可通过 brew、go install 与 GitHub Releases 安装。
- Zero-dependency static Go binary across macOS, Linux, Windows
能力覆盖与边际价值 14 / 15
采用恒定到达速率避免协调遗漏偏差,JSON 指标结构清晰。
- Constant-RPS pacing and multi-target stdin streams
维护与来源背书 8 / 10
成熟的开源项目 tsenart/vegeta(MIT 协议)。
tsenart/vegetarepository under MIT license
文档与可验证性 9 / 10
README 与各子命令 --help 说明清晰,JSON 报告字段明确。
- Comprehensive README for
attack,report,encode, andplot
安全边界、鉴权与放权指南
鉴权方式
无需鉴权 环境变量密钥
凭证存储位置
按次从 stdin 目标文件或 -header 参数读取请求头;不存储任何凭据。
潜在副作用
只读查询 远端写入
费用与配额提示
免费开源(MIT 协议)Go 二进制。
可复制到 CLAUDE.md / AGENTS.md 的安全护栏
# Vegeta Agent Rules - Always specify a finite `-duration=<time>` (e.g. `-duration=5s`); omitting `-duration` runs indefinitely (`0` = forever). - Never pipe `vegeta attack` raw binary bytes directly to terminal stdout without `| vegeta report` or `-output`.
Agent 高频安全命令配方
只读查询(安全推荐)
运行 5 秒恒定速率 GET 测试并输出 JSON 报告
echo 'GET http://localhost:8080/health' | vegeta attack -rate=20/s -duration=5s -timeout=5s | vegeta report -type=json
以 20 RPS 持续压测 5 秒并输出紧凑的 JSON 指标摘要。
受控写入与预演
保存原始压测采样并生成 JSON 报告
echo 'POST http://localhost:8080/items' | vegeta attack -rate=10/s -duration=5s -body=payload.json -header='Content-Type: application/json' -output=results.bin && vegeta report -type=json results.bin
将原始二进制采样写入 results.bin,便于后续执行 report 或 plot 分析。
核心优势
- +
attack | report -type=json管道可产出准确的恒定速率分位 JSON。 - + 无 ANSI 颜色干扰,支持多端点目标文件输入。
注意事项与踩坑点
- ! 忘记传入
-duration时vegeta attack默认持续运行(-duration=0)。 - !
vegeta attack默认向 stdout 输出二进制 gob 数据,必须管道接vegeta report。
已验证兼容的 Agent 宿主
Claude Code Codex CLI Gemini CLI