Token导航 LogoToken导航TokenDH.com
研究检索敏感数据clawhub未标认证来源可访问clear审计通过

perf-tester性能测试仪

Agent Skill

用于辅助测试设计、自动化测试、用例整理和回归验证。它适合让 Agent 编写单元测试、端到端测试、测试计划或根据失败日志定位问题。使用时需要确认项目测试框架、运行命令和夹具数据,避免为了通过测试而改坏真实逻辑;涉及浏览器或外部服务时,应区分本地模拟、测试环境和生产环境。

总安装

2,770

周安装

119

GitHub Stars

公开资料未说明

下载量

971
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:perf-tester(性能测试仪)
来源仓库:https://github.com/zhanghengyi1986-afk/perf-tester
安装命令:
openclaw skills install perf-tester
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install perf-tester

简介

perf-tester 用于辅助测试设计、自动化测试、用例整理和回归验证,适合编写单元测试、端到端测试或根据日志定位问题。

  • 使用时需要确认项目测试框架、运行命令和夹具数据,避免误改逻辑;涉及浏览器或服务时应区分环境。
  • 可结合来源仓库、安装命令和原始 README 继续核验具体用法。
  • 安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。
  • 它支持生成 k6/locust/JMeter 脚本,分析响应时间、吞吐量、错误率等性能指标。

SKILL.md

name
perf-tester
description
>

Performance Tester

Design, execute, and analyze performance tests.

Test Types (ISO 25010 Performance Efficiency)

TypePurposePatternDuration
BaselineEstablish normal metricsConstant low load5-10 min
LoadValidate under expected loadRamp to target users15-30 min
StressFind breaking pointRamp beyond capacityUntil failure
SpikeTest sudden traffic burstsInstant jump, then drop5-10 min
Soak/EnduranceDetect memory leaks, degradationConstant moderate load2-8 hours
ScalabilityMeasure scaling behaviorStep-increase load30-60 min

Workflow

  1. Define objectives: SLA targets (P95 < 500ms, error rate < 1%, TPS > 1000)
  2. Design scenarios: User journeys, think time, data variation
  3. Prepare environment: Isolated test env, monitoring enabled
  4. Execute baseline: Low load to establish reference metrics
  5. Execute tests: Ramp pattern per test type
  6. Collect metrics: Response time percentiles, throughput, errors, resource usage
  7. Analyze & report: Compare against SLA, identify bottlenecks

k6 Script Generation

When generating k6 scripts, use this pattern:

// k6 load test - {scenario_name}
// Reference: https://grafana.com/docs/k6/latest/
import http from 'k6/http';
import { check, sleep } from 'k6';
import { Rate, Trend } from 'k6/metrics';

// Custom metrics
const errorRate = new Rate('errors');
const latency = new Trend('request_latency');

// Test configuration
export const options = {
  // Load test: ramp up → hold → ramp down
  stages: [
    { duration: '2m', target: 50 },   // ramp up
    { duration: '5m', target: 50 },   // hold
    { duration: '2m', target: 100 },  // push higher
    { duration: '5m', target: 100 },  // hold peak
    { duration: '2m', target: 0 },    // ramp down
  ],
  thresholds: {
    http_req_duration: ['p(95)<500', 'p(99)<1000'], // ms
    errors: ['rate<0.01'],                           // <1% error
    http_req_failed: ['rate<0.01'],
  },
};

const BASE_URL = __ENV.BASE_URL || 'https://api.example.com';
const TOKEN = __ENV.TOKEN || '';

export default function () {
  const headers = {
    'Content-Type': 'application/json',
    'Authorization': `Bearer ${TOKEN}`,
  };

  // Scenario: List → Detail → Create
  const listRes = http.get(`${BASE_URL}/items`, { headers });
  check(listRes, {
    'list status 200': (r) => r.status === 200,
    'list has data': (r) => JSON.parse(r.body).length > 0,
  });
  errorRate.add(listRes.status !== 200);
  latency.add(listRes.timings.duration);

  sleep(1); // think time (RFC 6390 recommends realistic pacing)

  const detailRes = http.get(`${BASE_URL}/items/1`, { headers });
  check(detailRes, { 'detail status 200': (r) => r.status === 200 });
  errorRate.add(detailRes.status !== 200);

  sleep(0.5);

  const createRes = http.post(`${BASE_URL}/items`,
    JSON.stringify({ name: `test-${Date.now()}`, value: Math.random() }),
    { headers }
  );
  check(createRes, { 'create status 201': (r) => r.status === 201 });
  errorRate.add(createRes.status !== 201);

  sleep(1);
}

Run with:

# Install k6: https://grafana.com/docs/k6/latest/set-up/install-k6/
# Basic run
k6 run test.js

# With environment variables
k6 run --env BASE_URL=https://staging.example.com --env TOKEN=xxx test.js

# Output to JSON for analysis
k6 run --out json=results.json test.js

# Output to CSV
k6 run --out csv=results.csv test.js

k6 Stress Test Variant

export const options = {
  stages: [
    { duration: '2m', target: 100 },
    { duration: '5m', target: 100 },
    { duration: '2m', target: 200 },
    { duration: '5m', target: 200 },
    { duration: '2m', target: 300 },  // push beyond expected
    { duration: '5m', target: 300 },
    { duration: '5m', target: 0 },
  ],
  thresholds: {
    http_req_duration: ['p(95)<2000'],  // relaxed for stress
  },
};

k6 Spike Test Variant

export const options = {
  stages: [
    { duration: '1m', target: 10 },    // warm up
    { duration: '10s', target: 500 },   // spike!
    { duration: '3m', target: 500 },    // hold spike
    { duration: '10s', target: 10 },    // drop
    { duration: '3m', target: 10 },     // recovery
    { duration: '1m', target: 0 },
  ],
};

Locust Script Generation

For Python-based teams, generate locust scripts:

"""Locust load test - {scenario_name}
Reference: https://docs.locust.io/en/stable/
"""
from locust import HttpUser, task, between, tag

class APIUser(HttpUser):
    wait_time = between(1, 3)  # think time 1-3s
    host = "https://api.example.com"

    def on_start(self):
        """Login and get token on virtual user start."""
        resp = self.client.post("/auth/login",
            json={"username": "test", "password": "test"})
        self.token = resp.json().get("token", "")
        self.headers = {"Authorization": f"Bearer {self.token}"}

    @tag("read")
    @task(5)  # weight: 5x more likely than write
    def list_items(self):
        with self.client.get("/items", headers=self.headers,
                            catch_response=True) as resp:
            if resp.status_code != 200:
                resp.failure(f"Status {resp.status_code}")

    @tag("read")
    @task(3)
    def get_item(self):
        self.client.get("/items/1", headers=self.headers)

    @tag("write")
    @task(1)
    def create_item(self):
        self.client.post("/items",
            json={"name": "load-test", "value": 42},
            headers=self.headers)

Run with:

# Install: pip install locust
# Web UI mode
locust -f test_perf.py --host=https://api.example.com

# Headless mode (CI-friendly)
locust -f test_perf.py --headless -u 100 -r 10 --run-time 10m \
  --host=https://api.example.com --csv=results

# -u: total users, -r: spawn rate (users/sec)

Key Metrics (RFC 6390 / ISO 25010)

MetricDefinitionHealthy Range
P50 (Median)50th percentile response time< 200ms (API)
P9595th percentile response time< 500ms
P9999th percentile response time< 1000ms
TPS/RPSTransactions/Requests per secondPer SLA
Error RateFailed requests / total requests< 1%
ThroughputData transferred per secondStable under load
Concurrent UsersSimultaneous active connectionsPer capacity
Apdex(Satisfied + Tolerating×0.5) / Total> 0.85

Apdex Score (Application Performance Index)

Reference: Apdex Alliance Specification

Apdex_T = (Satisfied + Tolerating × 0.5) / Total_Samples

Where T = target threshold (e.g., 500ms):
- Satisfied: response ≤ T
- Tolerating: T < response ≤ 4T
- Frustrated: response > 4T
ApdexRating
0.94-1.00Excellent
0.85-0.93Good
0.70-0.84Fair
0.50-0.69Poor
< 0.50Unacceptable

Performance Analysis Template

## 📊 Performance Test Report

**Test Type**: Load / Stress / Spike / Soak
**Target System**: {service_name} {version}
**Test Duration**: {duration}
**Max Virtual Users**: {max_vus}

### Results Summary

| Metric | Target | Actual | Status |
|--------|--------|--------|--------|
| P50 | < 200ms | {val}ms | ✅/❌ |
| P95 | < 500ms | {val}ms | ✅/❌ |
| P99 | < 1000ms | {val}ms | ✅/❌ |
| Max TPS | > 1000 | {val} | ✅/❌ |
| Error Rate | < 1% | {val}% | ✅/❌ |
| Apdex (T=500ms) | > 0.85 | {val} | ✅/❌ |

### Observations
- {finding_1}
- {finding_2}

### Bottleneck Analysis
- **CPU**: {observation}
- **Memory**: {observation}
- **Network I/O**: {observation}
- **Database**: {observation} (slow queries, connection pool)

### Recommendations
1. {recommendation}

Quick curl-based Benchmark

For simple, no-dependency benchmarking:

# Sequential latency sampling (20 requests)
for i in $(seq 1 20); do
  curl -s -o /dev/null -w "%{time_total}" \
    -H "Authorization: Bearer $TOKEN" \
    "$URL/endpoint"
  echo
done | awk '{sum+=$1; if($1>max)max=$1; n++} END{printf "Avg: %.3fs, Max: %.3fs, N: %d\
", sum/n, max, n}'

# Apache Bench (ab) quick test
ab -n 1000 -c 50 -H "Authorization: Bearer $TOKEN" "$URL/endpoint"

References

For detailed configuration per tool, read the references directory:

  • k6 advanced patterns: See references/k6-patterns.md
  • Locust distributed mode: See references/locust-distributed.md

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

83.75%
按下载量换算813

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills