ghz-load
БесплатноБез исполняемых скриптовНе проверенUse when a gRPC service needs load testing or a latency regression gate: ghz runs with request count, concurrency, rate and duration, JSON, CSV or HTML…
от testland★ 18 звёзд на GitHubОб этом скилле
ghz-load
Overview
Per
ghz.sh/docs/usage, ghz accepts a
.proto (or compiled protoset), a method, a host:port, and
load parameters, and emits per-request metrics + a summary.
This skill wraps ghz for two use cases: ad-hoc throughput
measurement and CI regression gating.
When to use
- New gRPC service - what's the throughput ceiling?
- Suspected latency regression - quantify before / after a change.
- CI gate: each PR runs a short ghz pass and fails if p99 exceeds the previous baseline.
- Capacity planning - at what concurrency does the service hit its CPU/memory ceiling?
Authoring
Install
Per ghz.sh/docs/install:
# Homebrew
brew install ghz
# Go install
go install github.com/bojand/ghz/cmd/ghz@latest
Verify:
ghz --version
Configure a config.json
Per ghz docs, --config=path reads a JSON / TOML config. For
reproducibility, commit it to the repo:
{
"proto": "./proto/user.proto",
"import-paths": ["./proto", "./vendor"],
"call": "user.v1.UserService/GetUser",
"host": "localhost:8080",
"insecure": true,
"total": 10000,
"concurrency": 50,
"rps": 0,
"data": {
"id": "user-1"
},
"format": "json",
"output": "ghz-report.json",
"skipFirst": 100
}
skipFirst: 100 discards the first 100 requests (cold-cache /
warmup). Set per-service.
Running
Basic load test
ghz --proto=./proto/user.proto \
--call=user.v1.UserService/GetUser \
--insecure \
-n 10000 -c 50 \
-d '{"id": "user-1"}' \
localhost:8080
Per ghz.sh/docs/usage:
| Flag | Meaning |
|---|---|
--proto |
Path to the .proto file |
--protoset |
Path to a compiled descriptor set (alternative) |
--import-paths |
Comma-separated proto import paths |
--call |
package.Service/Method |
--insecure |
"Use plaintext and insecure connection" |
-n, --total=N |
"Number of requests to run. Default is 200" |
-c, --concurrency=N |
"Number of request workers to run concurrently" |
-r, --rps=N |
"Requests per second (RPS) rate limit"; 0 = unlimited |
-z, --duration=N |
Total duration (30s, 5m) - alternative to -n |
-t, --timeout=N |
Per-request timeout (default 20s) |
-d |
JSON message payload |
-D |
Path to a JSON file containing the payload |
Rate-limited (RPS pinning)
ghz --proto=./proto/user.proto \
--call=user.v1.UserService/GetUser \
--insecure \
-c 50 -z 60s -r 200 \
-d '{"id":"user-1"}' \
localhost:8080
Run for 60s, 50 concurrent workers, capped at 200 RPS. Useful for confirming the service can sustain the target rate.
Duration mode
ghz -z 5m -c 100 ...
When testing for stability / soak, -z beats -n - the test
ends after N minutes regardless of throughput.
Streaming methods
Streaming RPCs aren't natively load-tested by ghz; it sends one
unary call per worker per request. For streaming load see
grpc-streaming-test-author.
Parsing results
Summary (default summary format)
Summary:
Count: 10000
Total: 20.45 s
Slowest: 120.34 ms
Fastest: 2.15 ms
Average: 10.23 ms
Requests/sec: 488.94
Status code distribution:
Status code distribution:
[OK] 9983 responses
[DeadlineExceeded] 17 responses
Per the status-code catalog in grpc-streaming-test-author (references/status-codes.md),
any non-OK is a flag for investigation.
JSON output for CI consumption
ghz --config=ghz.config.json
# Writes ghz-report.json
Schema highlights:
{
"count": 10000,
"total": 20450000000,
"average": 10230000,
"fastest": 2150000,
"slowest": 120340000,
"rps": 488.94,
"latencyDistribution": [
{"percentage": 50, "latency": 8000000},
{"percentage": 95, "latency": 25000000},
{"percentage": 99, "latency": 80000000}
],
"statusCodeDistribution": {"OK": 9983, "DeadlineExceeded": 17},
"errorDistribution": {}
}
Latencies are nanoseconds.
Other formats
Per ghz.sh/docs/usage, --format
options: summary (default), csv, json, pretty, html,
influx-summary, influx-details. Use html for shareable
single-file reports; influx-* to ship metrics to InfluxDB.
CI integration
Baseline regression gate
# .github/workflows/grpc-perf.yml
name: grpc-perf
on:
pull_request:
paths:
- "service/**"
- "proto/**"
jobs:
ghz-baseline:
runs-on: ubuntu-latest
services:
service-under-test:
image: my-grpc-service:pr-${{ github.event.pull_request.number }}
ports: [8080]
steps:
- uses: actions/checkout@v5
- name: Install ghz
run: |
curl -L https://github.com/bojand/ghz/releases/download/v0.120.0/ghz-linux-x86_64.tar.gz | tar xz
# user-owned bin dir on PATH: no sudo, no write to /usr
Установить ghz-load в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл ghz-load?
Use when a gRPC service needs load testing or a latency regression gate: ghz runs with request count, concurrency, rate and duration, JSON, CSV or HTML output, and p50, p95 and p99 latency, RPS and error rates checked in CI.
Как установить скилл ghz-load?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл ghz-load запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic