performance-testing by aj-geddes/useful-ai-prompts
npx skills add https://github.com/aj-geddes/useful-ai-prompts --skill performance-testing性能测试用于衡量系统在各种负载条件下的行为,包括响应时间、吞吐量、资源利用率和可扩展性。它有助于识别瓶颈、验证性能要求,并确保系统能够处理预期的负载。
最小工作示例:
// load-test.js
import http from "k6/http";
import { check, sleep } from "k6";
import { Rate, Trend } from "k6/metrics";
// Custom metrics
const errorRate = new Rate("errors");
const orderDuration = new Trend("order_duration");
// Test configuration
export const options = {
stages: [
{ duration: "2m", target: 10 }, // Ramp up to 10 users
{ duration: "5m", target: 10 }, // Stay at 10 users
{ duration: "2m", target: 50 }, // Ramp up to 50 users
{ duration: "5m", target: 50 }, // Stay at 50 users
{ duration: "2m", target: 0 }, // Ramp down to 0
],
thresholds: {
http_req_duration: ["p(95)<500"], // 95% of requests under 500ms
http_req_failed: ["rate<0.01"], // Error rate under 1%
errors: ["rate<0.1"], // Custom error rate under 10%
},
};
// ... (see reference guides for full implementation)
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
references/ 目录下的详细实现:
| 指南 | 内容 |
|---|---|
| k6 for API Load Testing | 使用 k6 进行 API 负载测试 |
| Apache JMeter | Apache JMeter |
| pytest-benchmark for Python | 用于 Python 的 pytest-benchmark |
| JMH for Java Benchmarking | 用于 Java 基准测试的 JMH |
| Database Query Performance | 数据库查询性能 |
| Real-Time Monitoring | 实时监控 |
每周安装数
144
代码仓库
GitHub 星标数
121
首次出现
2026年1月21日
安全审计
安装于
opencode126
gemini-cli121
codex120
cursor112
github-copilot105
claude-code105
Performance testing measures how systems behave under various load conditions, including response times, throughput, resource utilization, and scalability. It helps identify bottlenecks, validate performance requirements, and ensure systems can handle expected loads.
Minimal working example:
// load-test.js
import http from "k6/http";
import { check, sleep } from "k6";
import { Rate, Trend } from "k6/metrics";
// Custom metrics
const errorRate = new Rate("errors");
const orderDuration = new Trend("order_duration");
// Test configuration
export const options = {
stages: [
{ duration: "2m", target: 10 }, // Ramp up to 10 users
{ duration: "5m", target: 10 }, // Stay at 10 users
{ duration: "2m", target: 50 }, // Ramp up to 50 users
{ duration: "5m", target: 50 }, // Stay at 50 users
{ duration: "2m", target: 0 }, // Ramp down to 0
],
thresholds: {
http_req_duration: ["p(95)<500"], // 95% of requests under 500ms
http_req_failed: ["rate<0.01"], // Error rate under 1%
errors: ["rate<0.1"], // Custom error rate under 10%
},
};
// ... (see reference guides for full implementation)
Detailed implementations in the references/ directory:
| Guide | Contents |
|---|---|
| k6 for API Load Testing | k6 for API Load Testing |
| Apache JMeter | Apache JMeter |
| pytest-benchmark for Python | pytest-benchmark for Python |
| JMH for Java Benchmarking | JMH for Java Benchmarking |
| Database Query Performance | Database Query Performance |
| Real-Time Monitoring | Real-Time Monitoring |
Weekly Installs
144
Repository
GitHub Stars
121
First Seen
Jan 21, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode126
gemini-cli121
codex120
cursor112
github-copilot105
claude-code105
Azure 升级评估与自动化工具 - 轻松迁移 Functions 计划、托管层级和 SKU
96,200 周安装