> For AI agents: the complete documentation index is available at https://nhanbe.id.vn/llms.txt, the full documentation bundle is available at https://nhanbe.id.vn/llms-full.txt.

# JMeter

## What is Apache JMeter?

Apache JMeter is an open-source tool designed to generate automated requests and simulate concurrent users to measure system performance.
It generates load and captures HTTP-level metrics such as response time, throughput, and error rate.
While originally built for HTTP testing, JMeter supports a wide range of protocols:

- HTTP / HTTPS
- REST API
- SOAP
- JDBC
- FTP
- JMS
- TCP
- LDAP

***

## Use Cases

### UC-1: Reproducing Concurrency Bugs

Example Scenario:
"The homepage slows down significantly around 9:00 AM."
Opening a browser returns a 200ms response time and hides the issue. Running JMeter with 500 simulated concurrent users reveals response times, CPU/Memory spikes, and error rates.

### UC-2: Component Performance Impact Verification

Example Scenario:
Page structure:

```text
Home -> Banner -> Hero -> Search Component -> Recommendation Component -> Footer
```

After modifying the Search Component, verify its performance impact:
Baseline average: 200ms. Post-change average: 400ms?
Executing JMeter with 100 requests reports Min, Max, Average, and 95th Percentile response times to determine if the component degrades page performance.

***

## Core Features & Usage Frequency

| Feature                      | Usage Frequency          |
| ---------------------------- | ------------------------ |
| Thread Group                 | Very High                |
| HTTP Request                 | Very High                |
| HTTP Header Manager          | Very High                |
| Cookie Manager               | Very High                |
| CSV Data Set Config          | High                     |
| Assertions                   | High                     |
| Response Time Report         | Very High                |
| Summary Report               | Very High                |
| View Results Tree            | High (Debugging focused) |
| Timers                       | Medium                   |
| Regular Expression Extractor | Medium                   |
| Authentication / Login Flow  | High                     |

***

## Basic Execution Setup

Publish Page Load Test Plan (Publisher):

```text
Test Plan
|___Thread Group
	|___HTTP Cookie Manager
	|___HTTP Request (Login)
	|___HTTP Request (Get Page)
	    |___Aggregate Report
	    |___Summary Report
	    |___View Results Tree
```

### Configuration

#### HTTP Cookie Manager Configuration

Add element: `Test Plan → Thread Group → Add → Config Element → HTTP Cookie Manager`

| Property                    | Value    |
| --------------------------- | -------- |
| Clear cookie each iteration | True     |
| Cookie Policy               | Standard |

#### Login HTTP Request Configuration

| Field       | Value                                                    |
| ----------- | -------------------------------------------------------- |
| Protocol    | http                                                     |
| Server name | localhost                                                |
| Port        | 4502                                                     |
| Method      | POST                                                     |
| Path        | `/libs/granite/core/content/login.html/j_security_check` |
| j\_username | admin                                                    |
| j\_password | admin                                                    |
| j\_validate | true                                                     |

#### Page HTTP Request Configuration

| Field       | Value                            |
| ----------- | -------------------------------- |
| Protocol    | http                             |
| Server name | localhost                        |
| Port        | 4502                             |
| Method      | GET                              |
| Path        | `/content/mysite/en/page-1.html` |
