mcpField
L
load-testing

load-testing

github.com/claude-dev-suiteTesting & quality4646 installsUpdated 2d ago
Repository

About load-testing

A load-testing skill that outlines k6, Artillery, and Locust examples, test types, and practices for planning and reviewing performance tests. It is for developers assessing application behavior under expected or higher traffic.

Key features

  1. 01Examples for k6, Artillery, and Locust
  2. 02Authenticated request patterns
  3. 03Smoke, load, stress, soak, and spike tests
  4. 04Guidance on thresholds and realistic scenarios

Use cases

  1. 01Create a load test for an API
  2. 02Choose a test type for a performance goal
  3. 03Review a load-test plan for common pitfalls

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/claude-dev-suite/claude-dev-suite --skill load-testing

After installing, type/load-testingin Claude Code to confirm it loaded.

Details

From the project README

Load Testing

k6 (recommended)

// load-test.js
import http from 'k6/http';
import { check, sleep } from 'k6';

export const options = {
  stages: [
    { duration: '1m', target: 50 },   // Ramp up to 50 users
    { duration: '3m', target: 50 },   // Stay at 50
    { duration: '1m', target: 100 },  // Ramp to 100
    { duration: '3m', target: 100 },  // Stay at 100
    { duration: '1m', target: 0 },    // Ramp down
  ],
  thresholds: {
    http_req_duration: ['p(95)<500', 'p(99)<1000'], // 95th < 500ms
    http_req_failed: ['rate<0.01'],                  // <1% error rate
  },
};

export default function () {
  const res = http.get('https://api.example.com/products');
  check(res, {
    'status is 200': (r) => r.status === 200,
    'response time < 500ms': (r) => r.timings.duration < 500,
  });
  sleep(1);
}
Authenticated Requests
import http from 'k6/http';

export function setup() {
  const res = http.post('https://api.example.com/auth/login', JSON.stringify({
    email: '[email protected]', password: 'test-password',
  }), { headers: { 'Content-Type': 'application/json' } });
  return { token: res.json('token') };
}

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

  // Simulate user journey
  http.get('https://api.example.com/products', { headers });
  sleep(2);
  http.get('https://api.example.com/products/1', { headers });
  sleep(1);
  http.post('https://api.example.com/orders', JSON.stringify({ productId: '1', qty: 2 }), { headers });
}

Artillery

# artillery.yml
config:
  target: "https://api.example.com"
  phases:
    - duration: 60
      arrivalRate: 10
      name: "Warm up"
    - duration: 120
      arrivalRate: 50
      name: "Sustained load"
  defaults:
    headers:
      Content-Type: "application/json"

scenarios:
  - name: "Browse and purchase"
    flow:
      - get:
          url: "/products"
          capture:
            - json: "$.data[0].id"
              as: "productId"
      - think: 2
      - get:
          url: "/products/{{ productId }}"
      - think: 1
      - post:
          url: "/orders"
          json:
            productId: "{{ productId }}"
            quantity: 1

Locust (Python)

from locust import HttpUser, task, between

class WebUser(HttpUser):
    wait_time = between(1, 3)

    def on_start(self):
        res = self.client.post("/auth/login", json={
            "email": "[email protected]", "password": "password"
        })
        self.token = res.json()["token"]
        self.headers = {"Authorization": f"Bearer {self.token}"}

    @task(3)
    def browse_products(self):
        self.client.get("/products", headers=self.headers)

    @task(1)
    def create_order(self):
        self.client.post("/orders", json={"productId": "1", "qty": 1}, headers=self.headers)

Test Types

TypePurposeDuration
SmokeVerify system works under minimal load1-2 min
LoadExpected normal/peak traffic10-30 min
StressBeyond normal capacity, find breaking point10-20 min
SoakSustained load to find memory leaks1-4 hours
SpikeSudden traffic burst5-10 min

Anti-Patterns

Anti-PatternFix
Testing from same network as serverTest from external network or cloud
No think time between requestsAdd realistic sleep/think delays
Single endpoint onlyTest realistic user journeys
No thresholds definedSet p95/p99 latency and error rate thresholds
Running load tests against productionUse staging environment

Production Checklist

  • Realistic user scenarios (not just single endpoints)
  • Thresholds for latency (p95, p99) and error rate
  • Ramp-up pattern matching expected traffic shape
  • Test data seeded (not reusing same record)
  • CI/CD integration for regression detection
  • Results archived for comparison over time

Comments

Markdown supported