# apache/jmeter architecture

> Architecture diagram of the GitHub repository apache/jmeter, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-05-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/apache/jmeter
- Repository: https://github.com/apache/jmeter

## Overview

Apache JMeter is a multi-module Gradle monorepo for load testing. Its architecture is centered on a shared test-plan model, an execution engine, pluggable protocol samplers, and multiple result-processing paths for GUI, CLI, and reporting.

1. Core execution model  
`src/core` contains the fundamental runtime: `TestElement`, `HashTree`-based test plans, thread groups, samplers, listeners, timers, assertions, config elements, and the `StandardJMeterEngine`. This is the main execution backbone used by both GUI and non-GUI runs.

2. Test plan lifecycle  
A typical flow is: author or import a test plan, serialize it to JMX/XML, load it back into the tree model, precompile it, then execute it through `JMeterThread` instances. The engine resolves functions, variables, config merging, and scoped elements before sampling starts.

3. GUI subsystem  
The Swing-based IDE lives mostly in `src/core` and `src/components`, with `MainFrame`, tree models, menus, actions, and many component-specific GUIs. It is not just a view layer: it is the primary editor for composing the test tree, controlling runs, viewing results, and launching report generation.

4. Protocol-specific samplers as plug-in modules  
Protocol support is split into dedicated modules under `src/protocol/*`: HTTP, JDBC, JMS, FTP, LDAP, TCP, Java, JUnit, mail/SMTP, native/system, and Bolt. Each module contributes samplers, config elements, GUIs, parsers, and resources, and plugs into the same core `Sampler`/`ConfigElement`/`Visualizer` contracts.

5. HTTP stack as the largest protocol boundary  
`src/protocol/http` is the most elaborate subsystem. It includes HTTP samplers, request builders, cookies, cache, auth, proxy/recording, HTML/CSS link extraction, curl parsing, and mirror-server support. This module is a full HTTP client/recording/correlation stack rather than a thin sampler wrapper.

6. Result collection and listeners  
Samples flow from samplers into listeners and collectors in `src/core` and `src/components`. Important consumers include `ResultCollector`, `Summariser`, visualizers, and backend listeners. They can persist raw results, compute summaries, render live graphs, or forward metrics to external systems.

7. Reporting pipeline  
The HTML dashboard/reporting system is in `src/core/src/main/java/org/apache/jmeter/report/**`. It reads sample logs, converts them into report data, runs aggregations and graph consumers, and emits static HTML/JSON dashboard artifacts. This is separate from the live GUI visualizers and is designed for post-run analysis.

8. Live metrics backends  
`src/components` contains backend listeners for Graphite and InfluxDB. These modules transform sample events into time-series metrics and send them over network protocols, enabling external observability tools to visualize test execution in near real time.

9. Save/load and serialization layer  
`src/core/src/main/java/org/apache/jmeter/save` handles JMX/XML persistence, CSV result I/O, and XStream-based converters. This layer is the boundary between in-memory test trees/results and disk artifacts such as test plans, result logs, and report inputs.

10. Remote/distributed execution  
The engine supports remote test execution through RMI-related classes in `src/core/src/main/java/org/apache/jmeter/engine` and `src/core/src/main/java/org/apache/jmeter/rmi`. The client/remote engine split allows a controller node to launch and coordinate test threads on remote agents.

11. Functions, scripting, and extensibility  
`src/functions`, `src/components`, and `src/protocol/java` provide a large function library and scriptable samplers/processors. JSR223, BeanShell, Groovy, regex/XPath/JSON extractors, and test bean infrastructure make the system extensible without changing the core engine.

12. Shared utility foundation  
`src/jorphan` is the shared support library used across modules. It provides collections, GUI helpers, reflection/service loading, logging wrappers, math/statistics, I/O utilities, and legacy compatibility classes. Many higher-level modules depend on it for non-domain-specific behavior.

13. Launchers, packaging, and distribution  
`src/launcher` contains startup entry points, while `src/dist` and `src/dist-check` verify assembled distributions. The top-level `bin` and `lib` directories define the runtime layout, scripts, examples, templates, and bundled resources used when JMeter is shipped or run from a distribution.

14. Build and test architecture  
The repository is built with Gradle and uses many module-level test suites, fixtures, and benchmark sources (`jmh`). Mixed Java/Kotlin code appears in core domains such as schemas, DSL/tree building, open-model thread groups, and GUI bindings, indicating a gradual modernization layer over the older Java/Swing architecture.

Overall data flow: test plan authoring or import → model tree persistence → engine precompilation → threaded sampling against protocol modules → listeners/reporters/backends → saved results and optional dashboard generation.

Main entry points: [`src/components`](https://github.com/apache/jmeter/tree/master/src/components) (Components), [`src/core/src/main/java/org/apache/jmeter/testelement`](https://github.com/apache/jmeter/tree/master/src/core/src/main/java/org/apache/jmeter/testelement) (Core Model), [`src/core/src/main/java/org/apache/jmeter/engine`](https://github.com/apache/jmeter/tree/master/src/core/src/main/java/org/apache/jmeter/engine) (Engine), [`src/jorphan`](https://github.com/apache/jmeter/tree/master/src/jorphan) (JOrphan)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_foundation["Foundation"]
  node_jorphan["JOrphan<br/>shared util library"]
  node_buildlogic["Build Logic<br/>gradle conventions"]
  node_testkit["Test Kits<br/>test support"]
end

subgraph group_runtime["Runtime"]
  node_coremodel["Core Model<br/>test plan model"]
  node_engine["Engine"]
  node_threads["Threads<br/>thread runtime"]
  node_save["Save/Load<br/>serialization layer"]
  node_gui["Swing GUI<br/>editor ui"]
  node_reporting["Reporting<br/>post-run analysis"]
  node_listeners["Listeners<br/>result pipeline"]
  node_functions["Functions<br/>expression library"]
  node_components["Components<br/>ui/plugin bundle"]
end

subgraph group_protocols["Protocols"]
  node_http["HTTP<br/>protocol stack"]
  node_jdbc["JDBC<br/>protocol module"]
  node_jms["JMS<br/>protocol module"]
  node_java["Java<br/>protocol module"]
  node_ldap["LDAP<br/>protocol module"]
  node_mail["Mail/SMTP<br/>protocol module"]
  node_tcp["TCP<br/>protocol module"]
  node_system["System<br/>protocol module"]
  node_bolt["Bolt<br/>protocol module"]
end

subgraph group_delivery["Delivery"]
  node_launcher["Launcher<br/>startup entrypoints"]
  node_dist["Distribution<br/>packaging assets"]
end

node_buildlogic -->|"builds"| node_coremodel
node_buildlogic -->|"builds"| node_components
node_buildlogic -->|"builds"| node_http
node_jorphan -->|"supports"| node_coremodel
node_jorphan -->|"supports"| node_gui
node_jorphan -->|"supports"| node_save
node_jorphan -->|"supports"| node_reporting
node_coremodel -->|"drives"| node_engine
node_coremodel -->|"compiled by"| node_threads
node_save -->|"persists"| node_coremodel
node_gui -->|"edits"| node_coremodel
node_gui -->|"runs"| node_engine
node_listeners -->|"feeds"| node_reporting
node_engine -->|"spawns"| node_threads
node_threads -->|"uses"| node_components
node_components -->|"emits"| node_listeners
node_functions -->|"expands"| node_engine
node_functions -->|"extends"| node_components
node_http -->|"implements"| node_components
node_jdbc -->|"implements"| node_components
node_jms -->|"implements"| node_components
node_java -->|"implements"| node_components
node_ldap -->|"implements"| node_components
node_mail -->|"implements"| node_components
node_tcp -->|"implements"| node_components
node_system -->|"implements"| node_components
node_bolt -->|"implements"| node_components
node_launcher -->|"starts"| node_engine
node_dist -->|"packages"| node_launcher
node_dist -->|"includes"| node_reporting
node_gui -->|"invokes"| node_reporting

click node_jorphan "https://github.com/apache/jmeter/tree/master/src/jorphan"
click node_buildlogic "https://github.com/apache/jmeter/tree/master/build-logic"
click node_testkit "https://github.com/apache/jmeter/tree/master/src/testkit"
click node_coremodel "https://github.com/apache/jmeter/tree/master/src/core/src/main/java/org/apache/jmeter/testelement"
click node_engine "https://github.com/apache/jmeter/tree/master/src/core/src/main/java/org/apache/jmeter/engine"
click node_threads "https://github.com/apache/jmeter/tree/master/src/core/src/main/java/org/apache/jmeter/threads"
click node_save "https://github.com/apache/jmeter/tree/master/src/core/src/main/java/org/apache/jmeter/save"
click node_gui "https://github.com/apache/jmeter/tree/master/src/core/src/main/java/org/apache/jmeter/gui"
click node_reporting "https://github.com/apache/jmeter/tree/master/src/core/src/main/java/org/apache/jmeter/report"
click node_listeners "https://github.com/apache/jmeter/tree/master/src/core/src/main/java/org/apache/jmeter/reporters"
click node_functions "https://github.com/apache/jmeter/tree/master/src/functions"
click node_components "https://github.com/apache/jmeter/tree/master/src/components"
click node_http "https://github.com/apache/jmeter/tree/master/src/protocol/http"
click node_jdbc "https://github.com/apache/jmeter/tree/master/src/protocol/jdbc"
click node_jms "https://github.com/apache/jmeter/tree/master/src/protocol/jms"
click node_java "https://github.com/apache/jmeter/tree/master/src/protocol/java"
click node_ldap "https://github.com/apache/jmeter/tree/master/src/protocol/ldap"
click node_mail "https://github.com/apache/jmeter/tree/master/src/protocol/mail"
click node_tcp "https://github.com/apache/jmeter/tree/master/src/protocol/tcp"
click node_system "https://github.com/apache/jmeter/tree/master/src/protocol/native"
click node_bolt "https://github.com/apache/jmeter/tree/master/src/protocol/bolt"
click node_launcher "https://github.com/apache/jmeter/tree/master/src/launcher"
click node_dist "https://github.com/apache/jmeter/tree/master/src/dist"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_jorphan,node_buildlogic,node_testkit toneBlue
class node_coremodel,node_engine,node_threads,node_save,node_gui,node_reporting,node_listeners,node_functions,node_components toneAmber
class node_http,node_jdbc,node_jms,node_java,node_ldap,node_mail,node_tcp,node_system,node_bolt toneMint
class node_launcher,node_dist toneRose
```

## Components

### Foundation

Shared libraries and build/runtime support

- [JOrphan](https://github.com/apache/jmeter/tree/master/src/jorphan): shared util library · Common collections, GUI, reflection, I/O, math, logging, and service-loading utilities · `src/jorphan`
- [Build Logic](https://github.com/apache/jmeter/tree/master/build-logic): gradle conventions · Shared Gradle plugins and build conventions used across modules · `build-logic`
- [Test Kits](https://github.com/apache/jmeter/tree/master/src/testkit): test support · Reusable test fixtures and support modules for integration and extension testing · `src/testkit`

### Runtime

Core test-plan model, engine, GUI, save/load, and reporting

- [Core Model](https://github.com/apache/jmeter/tree/master/src/core/src/main/java/org/apache/jmeter/testelement): test plan model · TestElement hierarchy, properties, thread groups, samplers, timers, and core abstractions · `src/core/src/main/java/org/apache/jmeter/testelement`
- [Engine](https://github.com/apache/jmeter/tree/master/src/core/src/main/java/org/apache/jmeter/engine): execution engine · Precompilation, thread orchestration, remote execution, and runtime sampling control · `src/core/src/main/java/org/apache/jmeter/engine`
- [Threads](https://github.com/apache/jmeter/tree/master/src/core/src/main/java/org/apache/jmeter/threads): thread runtime · JMeterThread, thread groups, compiler, variables, and execution-scoped context · `src/core/src/main/java/org/apache/jmeter/threads`
- [Save/Load](https://github.com/apache/jmeter/tree/master/src/core/src/main/java/org/apache/jmeter/save): serialization layer · JMX/XML persistence, CSV result I/O, and object converters · `src/core/src/main/java/org/apache/jmeter/save`
- [Swing GUI](https://github.com/apache/jmeter/tree/master/src/core/src/main/java/org/apache/jmeter/gui): editor ui · MainFrame, tree model, actions, and component editors for composing and running plans · `src/core/src/main/java/org/apache/jmeter/gui`
- [Reporting](https://github.com/apache/jmeter/tree/master/src/core/src/main/java/org/apache/jmeter/report): post-run analysis · HTML dashboard generation, sample readers, aggregations, and graph consumers · `src/core/src/main/java/org/apache/jmeter/report`
- [Listeners](https://github.com/apache/jmeter/tree/master/src/core/src/main/java/org/apache/jmeter/reporters): result pipeline · ResultCollector, Summariser, visualizers, and listener infrastructure for sample events · `src/core/src/main/java/org/apache/jmeter/reporters`
- [Functions](https://github.com/apache/jmeter/tree/master/src/functions): expression library · Built-in functions, variable expansion, scripting hooks, and helper utilities · `src/functions`
- [Components](https://github.com/apache/jmeter/tree/master/src/components): ui/plugin bundle · Shared assertions, extractors, controllers, timers, visualizers, backend listeners, and GUI bindings · `src/components`

### Protocols

Pluggable samplers and protocol-specific integrations

- [HTTP](https://github.com/apache/jmeter/tree/master/src/protocol/http): protocol stack · HTTP samplers, proxy/recording, parsing, auth, cookies, cache, curl import, and mirror server · `src/protocol/http`
- [JDBC](https://github.com/apache/jmeter/tree/master/src/protocol/jdbc): protocol module · Database samplers, datasource config, and JDBC pre/post processors · `src/protocol/jdbc`
- [JMS](https://github.com/apache/jmeter/tree/master/src/protocol/jms): protocol module · JMS publisher/subscriber samplers, message renderers, and client pooling · `src/protocol/jms`
- [Java](https://github.com/apache/jmeter/tree/master/src/protocol/java): protocol module · Java, BeanShell, BSF, JSR223, and JUnit sampler entry points · `src/protocol/java`
- [LDAP](https://github.com/apache/jmeter/tree/master/src/protocol/ldap): protocol module · LDAP and LDAP-ext samplers with config GUIs · `src/protocol/ldap`
- [Mail/SMTP](https://github.com/apache/jmeter/tree/master/src/protocol/mail): protocol module · Mail reader and SMTP samplers plus mail transport support · `src/protocol/mail`
- [TCP](https://github.com/apache/jmeter/tree/master/src/protocol/tcp): protocol module · TCP sampler, client implementations, and configuration GUIs · `src/protocol/tcp`
- [System](https://github.com/apache/jmeter/tree/master/src/protocol/native): protocol module · Native/system command sampler and GUI · `src/protocol/native`
- [Bolt](https://github.com/apache/jmeter/tree/master/src/protocol/bolt): protocol module · Bolt connection config and sampler plugin · `src/protocol/bolt`

### Delivery

Launchers, packaging, examples, and distribution assets

- [Launcher](https://github.com/apache/jmeter/tree/master/src/launcher): startup entrypoints · Main launchers and shutdown client used to start JMeter runtimes · `src/launcher`
- [Distribution](https://github.com/apache/jmeter/tree/master/src/dist): packaging assets · Distribution checks, release jars, scripts, templates, and bundled runtime layout · `src/dist`

## Connections

- Build Logic → Core Model: builds · Applies shared conventions to core sources
- Build Logic → Components: builds · Applies shared conventions to components module
- Build Logic → HTTP: builds · Applies shared conventions to protocol modules
- JOrphan → Core Model: supports · Provides collections, utilities, and reflection helpers used by core runtime
- JOrphan → Swing GUI: supports · Provides tree/table widgets and GUI utilities
- JOrphan → Save/Load: supports · Provides XML and serialization helpers
- JOrphan → Reporting: supports · Provides shared data structures and utilities for report processing
- Core Model → Engine: drives · Defines the test tree and runtime elements executed by the engine
- Core Model → Threads: compiled by · Test plan elements are compiled into execution packages for threads
- Save/Load → Core Model: persists · Serializes and restores test plans and test elements
- Swing GUI → Core Model: edits · Builds and manipulates the test-plan tree
- Swing GUI → Engine: runs · Starts, stops, and controls execution
- Listeners → Reporting: feeds · Sample logs and result collectors provide inputs for post-run reporting
- Engine → Threads: spawns · Creates and coordinates JMeterThread execution
- Threads → Components: uses · Thread execution invokes samplers, timers, assertions, and processors
- Components → Listeners: emits · Listeners and visualizers consume sample events and results
- Functions → Engine: expands · Function resolution and variable substitution happen during precompilation and execution
- Functions → Components: extends · Scripting and helper functions are used by processors and samplers
- HTTP → Components: implements · Provides HTTP samplers, config elements, and GUI plug-ins
- JDBC → Components: implements · Provides JDBC samplers and supporting components
- JMS → Components: implements · Provides JMS samplers and renderers
- Java → Components: implements · Provides scriptable and Java-based sampler extensions
- LDAP → Components: implements · Provides LDAP samplers and configuration UI
- Mail/SMTP → Components: implements · Provides mail and SMTP protocol samplers
- TCP → Components: implements · Provides TCP protocol support
- System → Components: implements · Provides native command execution sampler
- Bolt → Components: implements · Provides Bolt protocol sampler support
- Launcher → Engine: starts · Bootstraps the runtime and launches controller or server modes
- Distribution → Launcher: packages · Assembles runnable distribution layout and scripts
- Distribution → Reporting: includes · Ships dashboard templates and report resources
- Swing GUI → Reporting: invokes · Launches HTML report generation from the desktop UI
