Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

JMeter Load Testing

БесплатноБез исполняемых скриптовНе проверен

Load and performance testing skill using Apache JMeter, covering test plans, thread groups, assertions, listeners, timers, and distributed testing.

PramodDuttaот PramodDutta★ 253 звезды на GitHub

Об этом скилле

JMeter Load Testing Skill

You are an expert performance engineer specializing in Apache JMeter. When the user asks you to create, review, or debug JMeter test plans, follow these detailed instructions.

Core Principles

  1. Realistic load modeling -- Thread groups must simulate real user behavior with think times.
  2. Correlation -- Extract dynamic values (session IDs, tokens) from responses and reuse them.
  3. Parameterization -- Use CSV Data Set Config for test data; never hardcode user-specific values.
  4. Assertions everywhere -- Every sampler should have at least one assertion to verify correctness.
  5. Non-GUI execution -- Always run actual load tests from the command line, never the GUI.

Project Structure

jmeter/
  test-plans/
    smoke-test.jmx
    load-test.jmx
    stress-test.jmx
    api-test.jmx
  data/
    users.csv
    products.csv
    payloads/
      create-order.json
  lib/
    custom-plugins.jar
  scripts/
    run-load-test.sh
    generate-report.sh
  results/
    .gitkeep
  reports/
    .gitkeep
  jmeter.properties

Test Plan Structure

A well-organized JMeter test plan follows this hierarchy:

Test Plan
  ├── User Defined Variables
  ├── HTTP Request Defaults
  ├── HTTP Header Manager
  ├── HTTP Cookie Manager
  ├── CSV Data Set Config
  ├── Thread Group (User Flow)
  │     ├── Transaction Controller (Login)
  │     │     ├── HTTP Request (GET /login)
  │     │     ├── HTTP Request (POST /auth/login)
  │     │     ├── Response Assertion
  │     │     ├── JSON Extractor (token)
  │     │     └── JSR223 PostProcessor
  │     ├── Constant Timer (Think Time)
  │     ├── Transaction Controller (Browse Products)
  │     │     ├── HTTP Request (GET /products)
  │     │     └── Response Assertion
  │     └── Transaction Controller (Checkout)
  │           ├── HTTP Request (POST /cart)
  │           ├── HTTP Request (POST /checkout)
  │           └── Response Assertion
  ├── View Results Tree (debug only)
  ├── Summary Report
  └── Backend Listener (InfluxDB)

Thread Group Configuration

Standard Load Test

<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Load Test Users">
  <intProp name="ThreadGroup.num_threads">100</intProp>
  <intProp name="ThreadGroup.ramp_time">300</intProp>
  <boolProp name="ThreadGroup.scheduler">true</boolProp>
  <stringProp name="ThreadGroup.duration">1800</stringProp>
  <stringProp name="ThreadGroup.delay">0</stringProp>
  <boolProp name="ThreadGroup.same_user_on_next_iteration">false</boolProp>
</ThreadGroup>

Stepping Thread Group (Ultimate Thread Group Plugin)

Use the Ultimate Thread Group plugin for complex ramp patterns:

  • Start Threads Count -- Number of threads to add at each step
  • Initial Delay -- Wait before starting this step
  • Startup Time -- Time to ramp up these threads
  • Hold Load For -- Duration to maintain these threads
  • Shutdown Time -- Time to ramp down these threads

Example pattern for a load test:

Start Delay Startup Hold Shutdown
25 0s 60s 300s 30s
25 60s 60s 240s 30s
25 120s 60s 180s 30s
25 180s 60s 120s 30s

HTTP Request Defaults

Always configure HTTP Request Defaults at the test plan level:

Protocol: https
Server Name: ${BASE_URL}
Port Number: ${PORT}
Content Encoding: UTF-8
Implementation: HttpClient4
Connect Timeout: 5000
Response Timeout: 30000

Extractors and Correlation

JSON Extractor

Extract values from JSON responses:

Variable Names: auth_token
JSON Path Expressions: $.token
Match No.: 1
Default Values: NOT_FOUND

Regular Expression Extractor

For HTML or non-JSON responses:

Reference Name: csrf_token
Regular Expression: name="csrf_token" value="(.+?)"
Template: $1$
Match No.: 1
Default Value: NOT_FOUND

Boundary Extractor

Simpler alternative to regex:

Reference Name: session_id
Left Boundary: sessionId=
Right Boundary: ;
Match No.: 1

Using Extracted Values

In subsequent requests:

Header: Authorization: Bearer ${auth_token}
URL Path: /api/users/${user_id}
Body: {"sessionId": "${session_id}"}

Assertions

Response Assertion

Apply to: Main sample only
Field to Test: Response Code
Pattern Matching Rules: Equals
Patterns to Test: 200

JSON Assertion

Assert JSON Path exists: $.data.id
Expected Value: (leave empty to just check existence)
Additionally assert value: false

Duration Assertion

Duration in milliseconds: 2000

Size Assertion

Apply to: Main sample only
Size to Assert: Response body
Type of Comparison: < (less than)
Size in bytes: 1048576

Timers

Constant Timer

Thread Delay: 1000

Gaussian Random Timer

More realistic than constant timers:

Deviation: 500
Constant Delay Offset: 2000

This produces delays be

Полный SKILL.md на GitHub

Установить JMeter Load Testing в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл JMeter Load Testing?

Load and performance testing skill using Apache JMeter, covering test plans, thread groups, assertions, listeners, timers, and distributed testing.

Как установить скилл JMeter Load Testing?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл JMeter Load Testing запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить JMeter Load Testing с