agentleFS
MathiasPaulenkoMathiasPaulenko/ai-toolkit/skills/jmeter-load-testing/SKILL.md

jmeter-load-testing

Skill2 starsChanged 4 months agoMITView on GitHub

Load and performance testing with Apache JMeter. Covers test plan design, thread groups, samplers, assertions, listeners, distributed testing, and CI/CD integration.

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 7 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run in non-GUI mode for actual tests (GUI is for design only).

    line 230
  2. Distinctive:

    Use HTTP Cache Manager to simulate browser caching.

    line 231
  3. Distinctive:

    Use HTTP Cookie Manager for session state.

    line 232
  4. Distinctive:

    Add Think Time (Gaussian Random Timer) between requests.

    line 233
  5. Distinctive:

    Use Throughput Controller for mixed-load scenarios.

    line 234
  6. Distinctive:

    Start small (10 users) and ramp up gradually.

    line 236
  7. Distinctive:

    Use JSR223 PreProcessor with Groovy for complex logic (faster than BeanShell).

    line 237

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

JMeter Load Testing

1. Test Plan Structure

Test Plan
├── Thread Group
│   ├── HTTP Request Defaults
│   ├── HTTP Cookie Manager
│   ├── HTTP Header Manager
│   ├── CSV Data Set Config
│   ├── HTTP Request (Login)
│   ├── HTTP Request (Get Data)
│   └── HTTP Request (Submit)
├── View Results Tree (Debug)
├── Summary Report
└── Response Assertions

2. Thread Group Configuration

PropertyDescriptionExample
Number of ThreadsVirtual users100
Ramp-up PeriodSeconds to start all threads60 (1 user/sec)
Loop CountIterations per thread10
DurationTotal test duration (seconds)300
Startup DelayDelay before starting (seconds)0

3. HTTP Sampler

<!-- HTTP Request Sampler -->
<HTTPSamplerProxy>
  <stringProp name="HTTPSampler.domain">api.example.com</stringProp>
  <stringProp name="HTTPSampler.port">443</stringProp>
  <stringProp name="HTTPSampler.protocol">https</stringProp>
  <stringProp name="HTTPSampler.path">/api/v1/users</stringProp>
  <stringProp name="HTTPSampler.method">GET</stringProp>
  <elementProp name="HTTPsampler.Arguments" elementType="Arguments">
    <collectionProp name="Arguments.arguments">
      <elementProp name="limit" elementType="HTTPArgument">
        <boolProp name="HTTPArgument.always_encode">false</boolProp>
        <stringProp name="Argument.value">50</stringProp>
        <stringProp name="Argument.metadata">=</stringProp>
        <boolProp name="HTTPArgument.use_equals">true</boolProp>
        <stringProp name="Argument.name">limit</stringProp>
      </elementProp>
    </collectionProp>
  </elementProp>
</HTTPSamplerProxy>

4. CSV Data Set Config

# users.csv
username,password
alice,pass123
bob,pass456
charlie,pass789
<CSVDataSet>
  <stringProp name="filename">users.csv</stringProp>
  <stringProp name="variableNames">username,password</stringProp>
  <boolProp name="recycle">true</boolProp>
  <boolProp name="stopThread">false</boolProp>
  <stringProp name="sharingMode">All threads</stringProp>
</CSVDataSet>

5. Assertions

<!-- Response Assertion -->
<ResponseAssertion>
  <collectionProp name="testStrings">
    <stringProp name="">200</stringProp>
  </collectionProp>
  <stringProp name="custom_message">Expected 200 OK</stringProp>
  <intProp name="testType">16</intProp>  <!-- Contains -->
</ResponseAssertion>

<!-- JSON Assertion -->
<JSONPathAssertion>
  <stringProp name="JSON_PATH">$.status</stringProp>
  <stringProp name="EXPECTED_VALUE">success</stringProp>
  <boolProp name="JSONVALIDATION">true</boolProp>
</JSONPathAssertion>

6. Extractors (Correlation)

<!-- JSON Extractor for auth token -->
<JSONPostProcessor>
  <stringProp name="JSONPostProcessor.referenceNames">authToken</stringProp>
  <stringProp name="JSONPostProcessor.jsonPathExprs">$.token</stringProp>
  <stringProp name="JSONPostProcessor.match_numbers">1</stringProp>
</JSONPostProcessor>

<!-- Use extracted token in subsequent request -->
<HeaderManager>
  <collectionProp name="HeaderManager.headers">
    <elementProp name="Authorization" elementType="Header">
      <stringProp name="Header.name">Authorization</stringProp>
      <stringProp name="Header.value">Bearer ${authToken}</stringProp>
    </elementProp>
  </collectionProp>
</HeaderManager>

7. Listeners and Reporting

ListenerPurpose
View Results TreeDebug individual requests
Summary ReportAggregate statistics
Aggregate GraphResponse time distribution
Backend ListenerSend metrics to InfluxDB/Grafana

Backend Listener (InfluxDB)

<BackendListener>
  <stringProp name="classname">org.apache.jmeter.visualizers.backend.influxdb.InfluxDBBackendListenerClient</stringProp>
  <elementProp name="arguments" elementType="Arguments">
    <collectionProp name="Arguments.arguments">
      <elementProp name="influxdbUrl" elementType="Argument">
        <stringProp name="Argument.value">http://influxdb:8086/write?db=jmeter</stringProp>
      </elementProp>
      <elementProp name="application" elementType="Argument">
        <stringProp name="Argument.value">my-api</stringProp>
      </elementProp>
    </collectionProp>
  </elementProp>
</BackendListener>

8. Distributed Testing

Master (Controller)

jmeter -n -t test-plan.jmx -R slave1,slave2,slave3 -l results.jtl
# -n: non-GUI mode
# -t: test plan
# -R: remote servers
# -l: log file

Slave (Load Generator)

# Start JMeter server on each slave
./jmeter-server -Djava.rmi.server.hostname=slave1

Properties

# jmeter.properties
remote_hosts=slave1,slave2,slave3
server_port=1099
client.rmi.localport=0

9. CI/CD Integration

Jenkins Pipeline

pipeline {
    agent any
    stages {
        stage('Load Test') {
            steps {
                sh '''
                    jmeter -n -t api-load-test.jmx \
                           -l results.jtl \
                           -e -o dashboard
                '''
            }
        }
    }
    post {
        always {
            perfReport sourceDataFiles: 'results.jtl'
            publishHTML([
                reportDir: 'dashboard',
                reportFiles: 'index.html',
                reportName: 'JMeter Dashboard'
            ])
        }
    }
}

GitHub Actions

- name: Run JMeter Tests
  run: |
    wget https://archive.apache.org/dist/jmeter/binaries/apache-jmeter-5.6.3.tgz
    tar -xzf apache-jmeter-5.6.3.tgz
    ./apache-jmeter-5.6.3/bin/jmeter -n -t test-plan.jmx -l results.jtl

- name: Upload Results
  uses: actions/upload-artifact@v4
  with:
    name: jmeter-results
    path: results.jtl

10. Best Practices

  • Run in non-GUI mode for actual tests (GUI is for design only).
  • Use HTTP Cache Manager to simulate browser caching.
  • Use HTTP Cookie Manager for session state.
  • Add Think Time (Gaussian Random Timer) between requests.
  • Use Throughput Controller for mixed-load scenarios.
  • Monitor server resources during tests (CPU, memory, DB connections).
  • Start small (10 users) and ramp up gradually.
  • Use JSR223 PreProcessor with Groovy for complex logic (faster than BeanShell).

11. JSR223 Groovy Script

// PreProcessor: Generate dynamic payload
import groovy.json.JsonBuilder

def payload = new JsonBuilder([
    timestamp: System.currentTimeMillis(),
    userId: vars.get("userId"),
    action: "click"
]).toString()

sampler.addNonEncodedArgument("", payload, "")
sampler.setPostBodyRaw(true)

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.