返回 Skill 列表
extension
分类: 开发与工程无需 API Key

performance-benchmark

全面的性能测试框架,用于负载测试、压力测试和基准测试。测量吞吐量、延迟百分位数(p50、p95、p99)以及资源利用率。识别瓶颈并在不同版本间检测性能退化。

person作者: jakexiaohubgithub

Performance Benchmark Suite

Purpose

Comprehensive performance testing framework for load testing, stress testing, and benchmarking. Measures throughput, latency percentiles, and resource utilization. Identifies bottlenecks and detects performance regressions.

Triggers

Use this skill when:

  • "load test"
  • "benchmark"
  • "performance test"
  • "stress test"
  • "profile this code"
  • "find performance bottlenecks"
  • "measure latency"
  • "check for performance regression"

When to Use

  • Pre-production performance validation
  • Capacity planning
  • SLA verification
  • Release comparison
  • Cost optimization
  • Latency-sensitive applications

When NOT to Use

  • Functional testing (use unit-test-generator)
  • Security testing (use security-test-suite)
  • Data quality validation (use data-validation)

Core Instructions

Performance Test Types

| Type | Purpose | Duration | Load Pattern | | ---- | ------- | -------- | ------------ | | Baseline | Reference metrics | Minutes | Constant | | Load Test | Normal capacity | Minutes | Constant | | Stress Test | Breaking point | Minutes | Ramp-up | | Spike Test | Burst handling | Minutes | Sudden bursts | | Soak Test | Memory leaks | Hours | Constant |

Metrics Collected

| Metric | Description | Target | | ------ | ----------- | ------ | | Throughput | Requests per second | Maximize | | Latency (p50) | Median response time | Minimize | | Latency (p95) | 95th percentile | < SLA | | Latency (p99) | 99th percentile | < SLA | | Error Rate | Failed requests | < 0.1% | | CPU Usage | Processor utilization | < 80% | | Memory | RAM consumption | Stable |

Test Scenarios

scenarios:
  baseline:
    rps: 100
    duration: 300s

  load_test:
    stages:
      - duration: 60s
        target_rps: 100
      - duration: 300s
        target_rps: 500
      - duration: 60s
        target_rps: 100

  stress_test:
    start_rps: 100
    step_rps: 50
    step_duration: 60s
    stop_on_error_rate: 5.0

Templates

Performance Report

# Performance Benchmark Report

**Target:** {target_url}
**Generated:** {timestamp}

## Executive Summary

| Metric | Value |
| ------ | ----- |
| Total Requests | {total_requests} |
| Best Throughput | {best_rps} RPS |
| Worst p99 Latency | {worst_p99}ms |

## {test_name}

**Duration:** {duration}s
**Throughput:** {rps} RPS
**Error Rate:** {error_rate}%

### Latency Distribution

| Percentile | Latency (ms) |
| ---------- | ------------ |
| p50 | {p50} |
| p95 | {p95} |
| p99 | {p99} |
| Max | {max} |

### Threshold Violations

- {violation_description}

## Recommendations

- {recommendation}

Example

Input: Load test REST API endpoint

Output:

## Executive Summary

**Overall Status:** PASSED

| Metric | Value |
| ------ | ----- |
| Total Requests | 45,230 |
| Best Throughput | 523.4 RPS |
| Worst p99 Latency | 187.3ms |

## Baseline Test

**Throughput:** 100.0 RPS
**Error Rate:** 0.03%

### Latency Distribution

| Percentile | Latency (ms) |
| ---------- | ------------ |
| p50 | 23.4 |
| p95 | 67.8 |
| p99 | 98.2 |

Validation Checklist

  • [ ] System under test is isolated
  • [ ] Warmup period completed before measurement
  • [ ] Sufficient test duration for statistical significance
  • [ ] Resource monitoring data collected
  • [ ] Baseline comparison performed (if available)
  • [ ] All threshold violations documented
  • [ ] Recommendations actionable and specific

Related Skills

  • unit-test-generator - For function-level testing
  • api-contract-validator - For API correctness
  • test-health-monitor - For tracking performance trends