Performance Testing

aj-geddes/useful-ai-prompts/skills/performance-testing

by aj-geddes3f5182cfd739No license355 starsListed Oct 8, 2026Updated Oct 8, 2026Repository updated 7 months ago

Design and execute performance tests to measure response times, throughput, and resource utilization. Use for performance test, load test, JMeter, k6, benchmark, latency testing, and scalability analysis.

AI-generated overview

Design and run performance and load tests to measure latency, throughput, and resource use.

What it does
Guides the design and execution of performance tests, covering response times, throughput, resource utilization, and scalability. It provides reference material for k6 API load testing, Apache JMeter, pytest-benchmark, JMH, database query performance, and real-time monitoring, plus a quick-start k6 script with staged load and thresholds. It also ships a validation script and an API scaffold template, and lists best practices such as using percentiles and production-like environments.
When to use it
Use it when validating response-time requirements, measuring API throughput and latency, testing database query performance, or identifying bottlenecks. It also fits benchmarking before and after optimizations, checking caching effectiveness, and testing concurrent user capacity.
Requirements
Runs scripts: it ships an executable validation script and an API scaffold template. The reference guides assume tools such as k6, Apache JMeter, pytest-benchmark, and JMH, and testing targets typically require network access to the system under test.

Performance Testing

Table of Contents

Overview

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.

When to Use

  • Validating response time requirements
  • Measuring API throughput and latency
  • Testing database query performance
  • Identifying performance bottlenecks
  • Comparing algorithm efficiency
  • Benchmarking before/after optimizations
  • Validating caching effectiveness
  • Testing concurrent user capacity

Quick Start

Minimal working example:

javascript
// load-test.jsimport http from "k6/http";import { check, sleep } from "k6";import { Rate, Trend } from "k6/metrics";
// Custom metricsconst errorRate = new Rate("errors");const orderDuration = new Trend("order_duration");
// Test configurationexport 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)

Reference Guides

Detailed implementations in the references/ directory:

GuideContents
k6 for API Load Testing [blocked]k6 for API Load Testing
Apache JMeter [blocked]Apache JMeter
pytest-benchmark for Python [blocked]pytest-benchmark for Python
JMH for Java Benchmarking [blocked]JMH for Java Benchmarking
Database Query Performance [blocked]Database Query Performance
Real-Time Monitoring [blocked]Real-Time Monitoring

Best Practices

✅ DO

  • Define clear performance requirements (SLAs)
  • Test with realistic data volumes
  • Monitor resource utilization
  • Test caching effectiveness
  • Use percentiles (P95, P99) over averages
  • Warm up before measuring
  • Run tests in production-like environment
  • Identify and fix N+1 query problems

❌ DON'T

  • Test only with small datasets
  • Ignore memory leaks
  • Test in unrealistic environments
  • Focus only on average response times
  • Skip database indexing analysis
  • Test only happy paths
  • Ignore network latency
  • Compare without statistical significance

Source and attribution

Source:aj-geddes/useful-ai-promptsinskills/performance-testingat commit3f5182c

License: No license

Content belongs to its original authors. SourceWeft indexes it from a public repository.

Report or request removal