AGENT SKILL

x-run-perf-tests

Runs performance tests to validate latency SLAs, throughput targets, and resource stability under load. Supports baseline, normal, peak, and sustained scenarios.

License 许可
MIT
最近更新
2026-10-27
Stars
★ 0
Forks
1

01 前言 Front Matter

name
x-run-perf-tests
description
Runs performance tests to validate latency SLAs, throughput targets, and resource stability under load. Supports baseline, normal, peak, and sustained scenarios.
allowed-tools
Read, Write, Edit, Bash, Grep, Glob
argument-hint
[scenario: baseline|normal|peak|sustained|all] [--save-baseline] [--compare-baseline]
context-budget
light
user-invocable
true
requires-capabilities
[]

02 资源文件 1

03 SKILL.md 正文

Global Output Policy

  • Language: English ONLY.
  • Tone: Technical, Direct, and Concise.
  • Efficiency: Remove all conversational fillers and greetings to save tokens.

Skill: Performance / Load Tests

Purpose

Run or implement performance tests to validate the application meets latency SLAs, throughput targets, and resource stability requirements under various load conditions. Measure p50/p95/p99 latency, transactions per second (TPS), error rates, and memory stability.

Activation Condition

Include this skill for projects with performance testing requirements.

Triggers

  • /x-run-perf-tests baseline -- single user, sequential requests
  • /x-run-perf-tests normal -- expected daily load
  • /x-run-perf-tests peak -- maximum expected concurrent load
  • /x-run-perf-tests sustained -- constant load over extended period (30 min+)
  • /x-run-perf-tests all -- run all scenarios
  • /x-run-perf-tests normal --save-baseline -- save results as baseline
  • /x-run-perf-tests normal --compare-baseline -- compare against stored baseline

Parameters

Parameter Type Required Default Description
scenario String No all Scenario: baseline, normal, peak, sustained, all
--save-baseline Flag No false Save results to results/performance/baseline.json
--compare-baseline Flag No false Compare results against stored baseline

Prerequisites

  • Performance test framework configured (e.g., Gatling, k6, JMeter, Locust)
  • Application deployed and accessible (local or remote)
  • Test data feeders/generators available
  • Sufficient system resources for load generation

Workflow

Step 1 — Verify Prerequisites

  • Performance test framework installed and configured
  • Application running and healthy (check health endpoint)
  • Test data generators available

Step 2 — Select and Run Scenario

Baseline (single user warmup):

  • 1 connection/user, 100 sequential requests
  • Validates correctness and establishes latency baseline
  • Target: p99 < 100ms, 0% errors

Normal Load (daily traffic):

  • Ramp up to expected concurrent users over 30s
  • Sustain for 2-5 minutes
  • Target: p95 < 150ms, TPS > configured threshold, errors < 0.1%

Peak Load (traffic spike):

  • Rapid ramp to maximum concurrent users
  • Sustain for 1-2 minutes
  • Target: p99 < 500ms, errors < 0.5%, no crashes

Sustained Load (stability / memory leak detection):

  • Constant moderate load for 30+ minutes
  • Monitor memory growth over time
  • Target: p99 stable (no drift > 20%), memory growth < 10%, errors < 0.1%

Step 3 — Collect Metrics

  • Latency percentiles: p50, p75, p95, p99
  • Throughput: requests/transactions per second
  • Error rate: percentage of failed requests
  • Resource usage: memory (RSS), CPU utilization
  • Connection metrics: reuse rate, failures

Step 4 — Regression Detection (if --compare-baseline)

Compare current test results against stored baseline:

Metric Regression Condition Severity
p99 latency Current > baseline * 1.2 (20% degradation) FAIL
p95 latency Current > baseline * 1.15 (15% degradation) WARN
throughput (RPS) Current < baseline * 0.85 (15% drop) FAIL
error rate Current > baseline + 0.5% (absolute) FAIL

Step 5 — Generate Report

Summary table with all metrics vs SLA targets:

  • PASS/FAIL per SLA criterion
  • Latency distribution chart (if framework supports)
  • Recommendations for failures

SLA Targets (Defaults)

Metric Baseline Normal Peak Sustained
p50 latency < 10ms < 20ms < 50ms < 25ms
p95 latency < 50ms < 150ms < 300ms < 150ms
p99 latency < 100ms < 300ms < 500ms < 200ms
Error rate 0% < 0.1% < 0.5% < 0.1%
Memory growth N/A N/A N/A < 10%

Data Generation

Performance tests require realistic data generators:

  • Varied request payloads to avoid cache effects
  • Unique identifiers per request to prevent conflicts
  • Realistic distribution of operation types (e.g., 70% reads, 30% writes)
  • Randomized think time between requests for realistic pacing

Baseline Management

Save Baseline

When --save-baseline is specified:

  1. Execute the selected scenario
  2. Collect all metrics
  3. Write results to results/performance/baseline.json
  4. Overwrite existing baseline (with backup to baseline.prev.json)

baseline.json Structure

{
  "version": "1.0",
  "timestamp": "ISO-8601",
  "scenario": "normal",
  "metrics": {
    "endpoint_or_operation": {
      "p50_ms": 10,
      "p95_ms": 45,
      "p99_ms": 95,
      "throughput_rps": 1200,
      "error_rate_pct": 0.1
    }
  }
}

Threshold Validation

Metric Absolute Threshold Relative Threshold (vs baseline)
p99 latency Scenario SLA (see table above) +20% vs baseline
p95 latency Scenario SLA (see table above) +15% vs baseline
throughput Scenario minimum TPS -15% vs baseline
error rate Scenario max error rate +0.5% absolute vs baseline

Error Handling

Scenario Action
Performance framework not installed Report missing tool with install instructions
Application health check fails Abort with health check failure details
Baseline file not found for comparison Warn and continue without regression detection
SLA threshold exceeded Report FAIL with metric details and recommendations

Integration Notes

Skill Relationship Context
x-profile-performance calls Use /x-profile-performance cpu for latency regressions, memory for throughput regressions

Review Checklist

  • [ ] Baseline scenario establishes latency floor
  • [ ] Normal load matches expected daily traffic pattern
  • [ ] Peak load tests maximum concurrent capacity
  • [ ] Sustained load runs 30+ minutes for stability validation
  • [ ] Latency assertions defined per scenario (p50, p95, p99)
  • [ ] Error rate thresholds enforced
  • [ ] Memory growth monitored during sustained test
  • [ ] Connections are reused (persistent, not per-request)
  • [ ] Test data is varied and realistic
  • [ ] Results report generated with metrics vs SLA comparison
  • [ ] Rate limiting adjusted for test (not interfering with load)
  • [ ] Baseline saved for regression detection (if first run)
  • [ ] Regression comparison executed against stored baseline
  • [ ] Threshold validation passed for p99 and throughput

04 同仓库更多 Skills

review-bench
review-bench/edercnj_ia-dev-environment

x-parallel-eval

Detects and classifies file-collision risks between work units (tasks, stories, or epic phases) before parallel execution. Reads ## File Footprint blocks produced by x-task-plan / x-story-plan, applies the parallelism-heuristics knowledge pack (hard / regen / soft categories + hotspot overrides), and emits a collision matrix + serialization recommendation in Markdown (default) or JSON.

★ 0
review-bench
review-bench/edercnj_ia-dev-environment

parallelism-heuristics

Canonical catalog of file-collision heuristics for parallel task, story, and epic execution. Defines the File Footprint block format, the three Conflict Categories (hard / regen / soft), a hotspot list of high-contention paths, and the degrade-with-warning policy. Consumed by x-task-plan, x-story-plan, x-epic-map, x-parallel-eval, and x-dev-*-implement.

★ 0
review-bench
review-bench/edercnj_ia-dev-environment

x-watch-pr-ci

Polls a PR's CI checks and Copilot review status, blocking until checks complete or timeout. Returns one of 8 stable exit codes (SUCCESS=0, CI_PENDING_PROCEED=10, CI_FAILED=20, TIMEOUT=30, PR_ALREADY_MERGED=40, NO_CI_CONFIGURED=50, PR_CLOSED=60, PR_NOT_FOUND=70). Writes a versioned state-file for session resume.

★ 0
review-bench
review-bench/edercnj_ia-dev-environment

x-validate-docs

Documentation freshness gate: validates 6 dimensions (readme, api-specs, grpc-proto, adr, skill-docs, system-architecture) against code changes in a PR. Stack-aware — only validates targets declared/auto-detected from ProjectConfig.documentation.targets. Returns exit non-zero on staleness; produces structured report.

★ 0
review-bench
review-bench/edercnj_ia-dev-environment

x-update-system-architecture

Incrementally updates docs/architecture/system.md after an epic completes. Appends new entries to the Decision Log (§11) using x-internal-write-report --append (dedup by ## ID: marker) and surgically inserts component/integration changes into sections 1-10 via Edit. Idempotent: re-running with the same epic produces a byte-identical system.md.

★ 0
review-bench
review-bench/edercnj_ia-dev-environment

x-update-architecture

Incrementally updates the service architecture document with changes from architecture plans. Adds new components, integrations, flows, and ADR references without rewriting existing content. Use after implementation to keep architecture documentation current.

★ 0