{"id":25063810,"url":"https://github.com/anasoid/docker-jmeter","last_synced_at":"2025-04-14T17:53:43.030Z","repository":{"id":38018418,"uuid":"439464790","full_name":"anasoid/docker-jmeter","owner":"anasoid","description":"Docker jmeter, is advanced way to execute jmeter in docker with advanced feature","archived":false,"fork":false,"pushed_at":"2025-01-03T11:04:24.000Z","size":253,"stargazers_count":9,"open_issues_count":2,"forks_count":1,"subscribers_count":3,"default_branch":"develop","last_synced_at":"2025-01-03T12:22:19.080Z","etag":null,"topics":["arm","cloud","cluster","docker","jmeter","jmeter-docker","remote"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anasoid.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-17T21:29:45.000Z","updated_at":"2024-10-22T13:30:59.000Z","dependencies_parsed_at":"2022-09-14T00:41:40.801Z","dependency_job_id":"3bfd1e5a-0e3f-4e10-986c-cf19e95e1083","html_url":"https://github.com/anasoid/docker-jmeter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anasoid%2Fdocker-jmeter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anasoid%2Fdocker-jmeter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anasoid%2Fdocker-jmeter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anasoid%2Fdocker-jmeter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anasoid","download_url":"https://codeload.github.com/anasoid/docker-jmeter/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237531521,"owners_count":19325229,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arm","cloud","cluster","docker","jmeter","jmeter-docker","remote"],"created_at":"2025-02-06T18:54:07.092Z","updated_at":"2025-02-06T18:54:07.705Z","avatar_url":"https://github.com/anasoid.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Docker Build](https://github.com/anasoid/docker-jmeter/actions/workflows/docker.yml/badge.svg)](https://github.com/anasoid/docker-jmeter/actions/workflows/docker.yml)\n\n# Docker-JMeter\n\nYou can find image on [Docker Hub](https://hub.docker.com/r/anasoid/jmeter)\n\n# Quick reference\n\n- **Where to get help**:\n    - [Issues](https://github.com/anasoid/docker-jmeter/issues)\n    - [Discussions](https://github.com/anasoid/docker-jmeter/discussions)\n    - [Documentation](https://github.com/anasoid/docker-jmeter)\n\n## Image version\n\n### Jmeter 5.6\n- [`latest`, `5.6`, `5.6-21-jre`,`5.6.0`, `5.6.3-21-jre`](https://github.com/anasoid/docker-jmeter/blob/master/5.x/eclipse-temurin/Dockerfile)\n- [`latest-21-jdk`, `5.6-21-jdk`,`5.6.3-21-jdk`](https://github.com/anasoid/docker-jmeter/blob/master/5.x/eclipse-temurin/Dockerfile)\n- [`latest-plugins`, `5.6-plugins`, `5.6-plugins-21-jre`, `5.6.3-plugins`, `5.6.3-plugins-21-jre`](https://github.com/anasoid/docker-jmeter/blob/master/5.x/eclipse-temurin/Dockerfile)\n- [`latest-plugins-21-jdk`, `5.6-plugins-21-jdk`, `5.6.3-plugins-21-jdk`](https://github.com/anasoid/docker-jmeter/blob/master/5.x/eclipse-temurin/Dockerfile)\n- [`5.6-17-jre`,`5.6.0`, `5.6.3-17-jre`](https://github.com/anasoid/docker-jmeter/blob/master/5.x/eclipse-temurin/Dockerfile)\n- [`5.6-17-jdk`,`5.6.3-17-jdk`](https://github.com/anasoid/docker-jmeter/blob/master/5.x/eclipse-temurin/Dockerfile)\n- [`5.6-plugins`, `5.6-plugins-17-jre`, `5.6.3-plugins`, `5.6.3-plugins-17-jre`](https://github.com/anasoid/docker-jmeter/blob/master/5.x/eclipse-temurin/Dockerfile)\n- [`5.6-plugins-17-jdk`, `5.6.3-plugins-17-jdk`](https://github.com/anasoid/docker-jmeter/blob/master/5.x/eclipse-temurin/Dockerfile)\n- [`5.6`, `5.6-11-jre`,`5.6.0`, `5.6.3-11-jre`](https://github.com/anasoid/docker-jmeter/blob/master/5.x/eclipse-temurin/Dockerfile)\n- [`5.6-11-jdk`,`5.6.3-11-jdk`](https://github.com/anasoid/docker-jmeter/blob/master/5.x/eclipse-temurin/Dockerfile)\n- [`5.6-plugins`, `5.6-plugins-11-jre`, `5.6.3-plugins`, `5.6.3-plugins-11-jre`](https://github.com/anasoid/docker-jmeter/blob/master/5.x/eclipse-temurin/Dockerfile)\n- [`5.6-plugins-11-jdk`, `5.6.3-plugins-11-jdk`](https://github.com/anasoid/docker-jmeter/blob/master/5.x/eclipse-temurin/Dockerfile)\n\n### Jmeter 5.5\n- [`5.5`, `5.5-21-jre`](https://github.com/anasoid/docker-jmeter/blob/master/5.x/eclipse-temurin/Dockerfile)\n- [`5.5-21-jdk`](https://github.com/anasoid/docker-jmeter/blob/master/5.x/eclipse-temurin/Dockerfile)\n- [`5.5-plugins`, `5.5-plugins-21-jre`, `5.5.0-plugins`, `5.5.0-plugins-21-jre`](https://github.com/anasoid/docker-jmeter/blob/master/5.x/eclipse-temurin/Dockerfile)\n- [`5.5-plugins-21-jdk`, `5.5.3-plugins-21-jdk`](https://github.com/anasoid/docker-jmeter/blob/master/5.x/eclipse-temurin/Dockerfile)\n- [`5.5`, `5.5-17-jre`](https://github.com/anasoid/docker-jmeter/blob/master/5.x/eclipse-temurin/Dockerfile)\n- [`5.5-17-jdk`](https://github.com/anasoid/docker-jmeter/blob/master/5.x/eclipse-temurin/Dockerfile)\n- [`5.5-plugins`, `5.5-plugins-17-jre`, `5.5.0-plugins`, `5.5.0-plugins-17-jre`](https://github.com/anasoid/docker-jmeter/blob/master/5.x/eclipse-temurin/Dockerfile)\n- [`5.5-plugins-17-jdk`, `5.5.3-plugins-17-jdk`](https://github.com/anasoid/docker-jmeter/blob/master/5.x/eclipse-temurin/Dockerfile)\n- [`5.5`, `5.5-11-jre`](https://github.com/anasoid/docker-jmeter/blob/master/5.x/eclipse-temurin/Dockerfile)\n- [`5.5-11-jdk`](https://github.com/anasoid/docker-jmeter/blob/master/5.x/eclipse-temurin/Dockerfile)\n- [`5.5-plugins`, `5.5-plugins-11-jre`, `5.5.0-plugins`, `5.5.0-plugins-11-jre`](https://github.com/anasoid/docker-jmeter/blob/master/5.x/eclipse-temurin/Dockerfile)\n- [`5.5-plugins-11-jdk`, `5.5.3-plugins-11-jdk`](https://github.com/anasoid/docker-jmeter/blob/master/5.x/eclipse-temurin/Dockerfile)\n\n### Jmeter 5.4\n\n- [`5.4`, `5.4-11-jre`,`5.4.3`, `5.4.3-11-jre`](https://github.com/anasoid/docker-jmeter/blob/master/5.x/eclipse-temurin/Dockerfile)\n- [`5.4-11-jdk`,`5.4.3-11-jdk`](https://github.com/anasoid/docker-jmeter/blob/master/5.x/eclipse-temurin/Dockerfile)\n- [`5.4-plugins`, `5.4-plugins-11-jre`, `5.4.3-plugins`, `5.4.3-plugins-11-jre`](https://github.com/anasoid/docker-jmeter/blob/master/5.x/eclipse-temurin/Dockerfile)\n- [`5.4-plugins-11-jdk`, `5.4.3-plugins-11-jdk`](https://github.com/anasoid/docker-jmeter/blob/master/5.x/eclipse-temurin/Dockerfile)\n\n## Features\n\n1. Smallest size with ~110MB.\n2. ARM64 architecture available (only jvm 21), can be executed on oracle always free vm.\n2. Two versions: Native JMeter version and JMeter version with pre-configured plugin manager.\n3. Timeout for execution. After the timeout, docker will be stopped, even if test is not finished. This is helpful to\n   force stop JMeter docker after a timeout.\n4. Download plugin with maven dependencies format.\n5. Download plugin with list of URLs.\n6. Download plugin with plugin manager (Only plugins versions).\n7. Use plugins from folders.\n8. Check JMX Test (Only plugins versions)\n9. Split CSV Data on multi nodes.\n10. Execute pre/post test shell scripts.\n11. Separate Project configuration from node configuration, to separate configuration from execution team and developer\n    teams.\n12. Isolate output folder (logs, jtl files, html report).\n13. Any JMeter parameter can be used in arguments.\n14. No limitation is introduced by this image, JMeter can be used directly, if custom input parameters are not used.\n15. A delay can be performed using the check on the existence of a file.\n16. Monitoring Jmx with Jolokia (Work only with JDK image).\n\n## Content\n\n- [Docker-JMeter](#docker-jmeter)\n- [Quick reference](#quick-reference)\n    - [Image version](#image-version)\n    - [Features](#features)\n    - [Content](#content)\n- [Image Variants](#image-variants)\n    - [`jmeter:\u003cjmeter-version\u003e-plugins-*`](#jmeterjmeter-version-plugins-)\n- [Folder structure](#folder-structure)\n    - [Image Folder structure](#image-folder-structure)\n    - [Project folder structure](#project-folder-structure)\n    - [User Folder structure](#user-folder-structure)\n    - [Configuration](#configuration)\n- [Exposed Port](#exposed-port)\n- [Plugins installation](#plugins-installation)\n    - [Download plugins with Maven format](#download-plugins-with-maven-format)\n    - [Download Plugins dependencies with Maven format](#download-plugins-dependencies-with-maven-format)\n    - [Download dependencies with zip format](#download-dependencies-with-zip-format)\n    - [Download dependencies automatically with plugin manager](#download-dependencies-automatically-with-plugin-manager)\n    - [Download dependencies list with plugin manager](#download-dependencies-list-with-plugin-manager)\n    - [Use plugins and dependencies from project or user folder](#use-plugins-and-dependencies-from-project-or-user-folder)\n    - [Use plugins and dependencies as additional lib](#use-plugins-and-dependencies-as-additional-lib)\n- [Test plan check](#test-plan-check)\n- [Split CSV files](#split-csv-files)\n- [Timezone](#timezone)\n- [JMX Monitoring (Jolokia)](#jmx-monitoring-jolokia)\n- [Examples](#examples)\n    - [Change JVM Memory size](#change-jvm-memory-size)\n    - [Use additional properties files](#use-additional-properties-files)\n    - [Use timeout for JMeter execution](#use-timeout-for-jmeter-execution)\n    - [Execute before-test.sh/after-test.sh only on master node](#execute-before-testshafter-testsh-only-on-master-node)\n    - [Generate JTL, HTML report and log file](#generate-jtl-html-report-and-log-file)\n    - [Using additional raw JMeter parameter](#using-additional-raw-jmeter-parameter)\n    - [Using raw JMeter parameter](#using-raw-jmeter-parameter)\n    - [Using wait to be Ready](#using-wait-to-be-ready)\n- [Best Practice](#best-practice)\n\n# Image Variants\n\nThe `JMeter` images come in many flavors, each designed for a specific use case.\nThe images version are based on component used to build image:\n\n1. **JMeter Version**: 5.5.0 -\u003e default for 5.5.\n2. **JVM Version**: e.g.: (-11-jre, default for 11-jre),a nd default JVM is `eclipse-temurin`.\n3. **plugins** : Pre-installed [plugins manager](https://jmeter-plugins.org/wiki/PluginsManagerAutomated/)\n   and [test plan check tool](https://jmeter-plugins.org/wiki/TestPlanCheckTool/). This will provide the image with the\n   feature to check JMX file and download plugins with plugin manager.\n\n## `jmeter:\u003cjmeter-version\u003e-plugins-*`\n\nThis is the image containing pre-installed [plugins manager](https://jmeter-plugins.org/wiki/PluginsManagerAutomated/)\nand [test plan check tool](https://jmeter-plugins.org/wiki/TestPlanCheckTool/). This will provide the image with the\nfeature to check JMX file and download plugins with plugin manager.\n\n# Folder structure\n\n## Image Folder structure\n\n| Folder/files                      | Environnement variable  | Description                                                                                                                                                                                                                                      |\n|-----------------------------------|-------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `/opt/apache-jmeter`              | `JMETER_HOME`           | Installation of JMeter                                                                                                                                                                                                                           |\n| `/jmeter/additional/lib`          | `JMETER_ADDITIONAL_LIB` | Additional lib for JMeter folder using property [plugin_dependency_paths](https://jmeter.apache.org/usermanual/properties_reference.html#classpath)                                                                                              |\n| `/jmeter/additional/lib/ext`      | `JMETER_ADDITIONAL_EXT` | Additional plugins for JMeter folder using property [search_paths](https://jmeter.apache.org/usermanual/properties_reference.html#classpath)                                                                                                     |\n| `/jmeter/project`                 | `PROJECT_PATH`          | Project folder, where JMX file should be present.                                                                                                                                                                                                |\n| `/jmeter/workspace`               | `WORKSPACE_TARGET`      | If duplicate project folder by ( `$CONF_COPY_TO_WORKSPACE` ) is chosen, this will be the target folder. `$WORKSPACE_PATH` will be the workspace folder depending on duplicating project or not it will be `$WORKSPACE_TARGET` or `$PROJECT_PATH` |\n| `/jmeter/user`                    | `USER_PATH`             | Second folder to be used to configure project execution.                                                                                                                                                                                         |\n| `/jmeter/out`                     | `OUTPUT_PATH`           | Base output folder                                                                                                                                                                                                                               |\n| `$OUTPUT_PATH/jtl`                | `OUTPUT_JTL_PATH`       | Default JTL destination folder                                                                                                                                                                                                                   |\n| `$OUTPUT_PATH/log`                | `OUTPUT_LOG_PATH`       | Default log destination folder                                                                                                                                                                                                                   |\n| `$OUTPUT_PATH/csv`                | `OUTPUT_CSV_PATH`       | Default divided csv destination folder, only for debugging.                                                                                                                                                                                      |\n| `$OUTPUT_PATH/dashboard`          | `OUTPUT_REPORT_PATH`    | Default Report base folder                                                                                                                                                                                                                       |\n| `/opt/jolokia/jolokia.properties` | `JOLOKIA_CONFIG`        | Jolokia configuration file : \u003chttps://jolokia.org/reference/html/agents.html#agents-jvm\u003e                                                                                                                                                         |\n\n## Project folder structure\n\n| Folder/files                                    | Description                                                                                                                                     |\n|-------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------|\n| `lib`                                           | lib folder, files in this folder will be copied to $JMETER_HOME/lib                                                                             |\n| `plugins`                                       | plugins folder, files in this folder will be copied to $JMETER_HOME/lib/ext                                                                     |\n| `dependencies/url.txt`                          | URLs in this file will be download and extracted to $JMETER_HOME                                                                                |\n| `dependencies/settings.xml`                     | settings.xml used by maven, if there is any need to not authentication for maven repository or a custom one                                     |\n| `dependencies/plugins-lib-dependencies.xml`     | Dependencies plugins, jar present in this file will be copied to folder \"lib\" in JMeter.                                                        |\n| `dependencies/plugins-lib-ext-dependencies.xml` | Plugins, jar present in this file will be copied to folder \"lib/ext\" in JMeter.                                                                 |\n| `scripts/after-test.sh`                         | This script will be executed after JMeter test ends. To be executed after test in slave, JMeter should be stopped after test wth `$JMETER_EXIT` |\n| `scripts/before-test.sh`                        | This script will be executed before JMeter starts                                                                                               |\n| `jmeter.properties`                             | default value properties file.                                                                                                                  |\n\nExample of project folder: (\u003chttps://github.com/anasoid/docker-jmeter/tree/develop/tests/projects/sample1\u003e)\n\n## User Folder structure\n\nSame as project folder, the only different JMX file is not used from this folder.\n\nExample of User folder: (\u003chttps://github.com/anasoid/docker-jmeter/tree/develop/tests/users/user1\u003e)\n\n## Configuration\n\nThis environment variable are input to configure JMeter and execution:\n\n| Environment variables                    | default value       | Description                                                                                                                                                                                                                                                                                                                                                                      |\n|------------------------------------------|---------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `CONF_SKIP_PLUGINS_INSTALL`              | `false`             | Skip plugin installation from maven, and url.txt and folder.                                                                                                                                                                                                                                                                                                                     |\n| `CONF_SKIP_PRE_ACTION`                   | `false`             | Skip Execution of after-test.sh                                                                                                                                                                                                                                                                                                                                                  |\n| `CONF_SKIP_POST_ACTION`                  | `false`             | Skip Execution of before-test.sh                                                                                                                                                                                                                                                                                                                                                 |\n| `CONF_COPY_TO_WORKSPACE`                 | `false`             | Copy project to `$WORKSPACE_TARGET`, before executing test, this feature can be used with `$CONF_CSV_SPLIT` to not change file on project folder which can be shared with multiple slave.                                                                                                                                                                                        |\n| `CONF_WITH_JOLOKIA`                      | `false`             | Enable Jolokia for JMX monitoring, This featue work only with JDK version                                                                                                                                                                                                                                                                                                        |\n| `CONF_EXEC_IS_SLAVE`                     | `false`             | True, to be slave node, this will add \" --server \" as argument for JMeter, this variable can be also used on scripts to choose if action can be executed also on slave or only master.                                                                                                                                                                                           |\n| `CONF_EXEC_WORKER_COUNT`                 | `1`                 | Total JMeter slave count. This value is used only to split CSV file.                                                                                                                                                                                                                                                                                                             |\n| `CONF_EXEC_WORKER_NUMBER`                | `1`                 | Number of current slave. This value is used only to split CSV file.                                                                                                                                                                                                                                                                                                              |\n| `CONF_EXEC_WAIT_BEFORE_TEST`             | `0`                 | Wait in second before start JMeter.                                                                                                                                                                                                                                                                                                                                              |\n| `CONF_EXEC_WAIT_AFTER_TEST`              | `1`                 | Wait in second after stopping JMeter.                                                                                                                                                                                                                                                                                                                                            |\n| `CONF_EXEC_TIMEOUT`                      | `2592000`           | Default timeout in second, after this duration JMeter and docker container wil be stopped, default (30 days)                                                                                                                                                                                                                                                                     |\n| `CONF_READY_WAIT_FILE`                   |                     | The file to wait until exists to start execution, if file start with `/` the file will be considered as absolute path, if not it will be considered as relative path to `PROJECT_PATH`, this option is useful when we need to start container than copy project to container without using mount specially on Kubernetes.                                                        |\n| `CONF_READY_WAIT_TIMEOUT`                | `1200`              | Default timeout for waiting the ready file to be present in seconds                                                                                                                                                                                                                                                                                                              |\n| `CONF_CSV_SPLIT`                         | `false`             | Split csv file on `$CONF_EXEC_WORKER_COUNT` and take the part `CONF_EXEC_WORKER_COUNT`                                                                                                                                                                                                                                                                                           |\n| `CONF_CSV_SPLIT_PATTERN`                 | `**`                | Pattern used to choose csv file to be divided, a default filter (\\*.csv) is already used so only CSV files are concerned by this split, the pattern is applied relative path for file, so patten can be applied on folder or file name. (e.g.: \"./data/\\*.csv\" for csv file in \"data\" folder, \"./data/\\*\\_split.csv\" for csv files in \"data\" folder with suffix \"\\*\\_split.csv\") |\n| `CONF_CSV_WITH_HEADER`                   | `true`              | Split CSV file has header or not.                                                                                                                                                                                                                                                                                                                                                |\n| `CONF_CSV_DIVIDED_TO_OUT`                | `true`              | Copy divided files to `$OUTPUT_CSV_PATH`, only for debugging.                                                                                                                                                                                                                                                                                                                    |\n| `JMETER_JMX`                             |                     | JMX test file.                                                                                                                                                                                                                                                                                                                                                                   |\n| `JMETER_EXIT`                            | `false`             | Force exit after test on all node.                                                                                                                                                                                                                                                                                                                                               |\n| `JMETER_PROPERTIES_FILES`                | `jmeter.properties` | List of properties file to be used as additional properties, (e.g. :\"size.properties preprod.properties\"). This list will be added from project and user folder if file is present.                                                                                                                                                                                              |\n| `JMETER_PROPERTIES_OPTIONAL`             | `false`             | Ignore properties files if not found.                                                                                                                                                                                                                                                                                                                                            |\n| `JMETER_JTL_FILE`                        |                     | Name of JTL result file, will be saved in folder `$OUTPUT_JTL_PATH`                                                                                                                                                                                                                                                                                                              |\n| `JMETER_LOG_FILE`                        | `jmeter.log`        | JMeter log file name `$OUTPUT_LOG_PATH`                                                                                                                                                                                                                                                                                                                                          |\n| `JMETER_REPORT_NAME`                     |                     | HTML report name, will be saved in folder `$OUTPUT_REPORT_PATH`                                                                                                                                                                                                                                                                                                                  |\n| `JMETER_JVM_ARGS`                        |                     | JMeter JVM arguments, can configure JVM with Xmx, Xms, ...                                                                                                                                                                                                                                                                                                                       |\n| `JMETER_JVM_EXTRA_ARGS`                  |                     | A second Parameter to configure JVM arguments.                                                                                                                                                                                                                                                                                                                                   |\n| `JMETER_DEFAULT_ARGS`                    | `--nongui`          | A default arguments, by default JMeter is executed in a non-GUI mode (headless mode).                                                                                                                                                                                                                                                                                            |\n| `JMETER_CHECK_ONLY`                      | `false`             | Don't execute test but only do a check with [test plan check tool](https://jmeter-plugins.org/wiki/TestPlanCheckTool/), available only on (variant plugins)                                                                                                                                                                                                                      |\n| `JMETER_PLUGINS_MANAGER_INSTALL_LIST`    |                     | Install list of plugins using [plugins manager](https://jmeter-plugins.org/wiki/PluginsManagerAutomated/) (e.g. : \"jpgc-json=2.2,jpgc-casutg=2.0\"),                                                                                                                                                                                                                              |\n| `JMETER_PLUGINS_MANAGER_INSTALL_FOR_JMX` | `false`             | Install needed plugins for jmx file automatically using [plugins manager](https://jmeter-plugins.org/wiki/PluginsManagerAutomated/)                                                                                                                                                                                                                                              |\n\n# Exposed Port\n\n1. The exposed RMI port is 1099. See doc on \u003chttps://jmeter.apache.org/usermanual/remote-test.html\u003e\n2. Jolokia port 8778.\n\n# Plugins installation\n\nPlugins can be provided in many ways.\nWe distinguish two types of lib dependencies, the plugins and plugins dependencies. In JMeter they are in different\nfolders lib/ext and lib respectively.\n\n## Download plugins with Maven format\n\nIn `project folder` or `user folder` put maven xml file `dependencies/plugins-lib-ext-dependencies.xml`, use exclusion\nwith \\* to not download dependencies of JARs, only JAR referenced in file will be used.\nJAR from this file will be downloaded to folder `$JMETER_HOME/lib/ext`.\ne.g.:\n\n```xml\n\n\u003cproject xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\"\u003e\n    \u003cmodelVersion\u003e4.0.0\u003c/modelVersion\u003e\n    \u003cgroupId\u003eorg.anasoid.jmeter.docker\u003c/groupId\u003e\n    \u003cversion\u003e1\u003c/version\u003e\n    \u003cpackaging\u003epom\u003c/packaging\u003e\n\n    \u003cartifactId\u003esample-lib-ext\u003c/artifactId\u003e\n\n    \u003cdependencies\u003e\n        \u003cdependency\u003e\n            \u003cgroupId\u003ecom.blazemeter\u003c/groupId\u003e\n            \u003cartifactId\u003ejmeter-plugins-random-csv-data-set\u003c/artifactId\u003e\n            \u003cversion\u003e0.8\u003c/version\u003e\n            \u003cexclusions\u003e\n                \u003cexclusion\u003e\n                    \u003cgroupId\u003e*\u003c/groupId\u003e\n                    \u003cartifactId\u003e*\u003c/artifactId\u003e\n                \u003c/exclusion\u003e\n            \u003c/exclusions\u003e\n        \u003c/dependency\u003e\n        \u003cdependency\u003e\n            \u003cgroupId\u003ekg.apc\u003c/groupId\u003e\n            \u003cartifactId\u003ejmeter-plugins-graphs-additional\u003c/artifactId\u003e\n            \u003cversion\u003e2.0\u003c/version\u003e\n            \u003cexclusions\u003e\n                \u003cexclusion\u003e\n                    \u003cgroupId\u003e*\u003c/groupId\u003e\n                    \u003cartifactId\u003e*\u003c/artifactId\u003e\n                \u003c/exclusion\u003e\n            \u003c/exclusions\u003e\n        \u003c/dependency\u003e\n    \u003c/dependencies\u003e\n\u003c/project\u003e\n```\n\n## Download Plugins dependencies with Maven format\n\nIn `project folder` or `user folder` put maven XML file `dependencies/plugins-lib-dependencies.xml`, use exclusion\nwith \\* to not download dependencies of JARS, only JAR referenced in file will be used.\nJAR from this file will be downloaded to folder `$JMETER_HOME/lib`.\nSame format used by [plugins](#download-plugins-with-maven-format)\n\n## Download dependencies with zip format\n\nIn `project folder` or `user folder` put file `dependencies/url.txt` with list of ZIP URLs. These ZIPs use the same\nJMeter structure with lib and lib/ext folder. The download ZIP links from website \u003chttps://jmeter-plugins.org/\u003e are\ncompatible with this file.\n\n**N.B.**: ZIP files from \u003chttps://jmeter-plugins.org/\u003e contain also JMeter plugin manager and other common JARs, these\nJARs can be duplicated when using multiple plugins.\n\n## Download dependencies automatically with plugin manager\n\nUse [version with plugins](#jmeterjmeter-version-plugins-) to have pre-configured plugin manager.\nUse env variable JMETER_PLUGINS_MANAGER_INSTALL_FOR_JMX to download plugin before starting JMeter\nwith [plugins manager](https://jmeter-plugins.org/wiki/PluginsManagerAutomated/):\n\n```sh\ndocker run --rm \\\n-v ${PWD}/tests/projects/sample1/:/jmeter/project \\\n-e JMETER_JMX=\"test-plan.jmx\" \\\n-e JMETER_PLUGINS_MANAGER_INSTALL_FOR_JMX=\"true\" \\\nanasoid/jmeter:latest-plugins\n```\n\n## Download dependencies list with plugin manager\n\nUse [version with plugins](#jmeterjmeter-version-plugins-) to have pre-configured plugin manager.\nUse env variable JMETER_PLUGINS_MANAGER_INSTALL_LIST to download plugin before starting JMeter\nwith [plugins manager](https://jmeter-plugins.org/wiki/PluginsManagerAutomated/):\n\n```sh\ndocker run --rm \\\n-v ${PWD}/tests/projects/sample1/:/jmeter/project \\\n-e JMETER_JMX=\"test-plan.jmx\" \\\n-e JMETER_PLUGINS_MANAGER_INSTALL_LIST=\"jpgc-json=2.2,jpgc-casutg=2.0\" \\\nanasoid/jmeter:latest-plugins\n```\n\n## Use plugins and dependencies from project or user folder\n\nBefore starting JMeter, the folders `/jmeter/project/plugins` and `/jmeter/user/plugins` are copied\nto `$JMETER_HOME/lib/ext`, and folders `/jmeter/project/lib` and `/jmeter/user/lib` are copied to `$JMETER_HOME/lib`.\n\n## Use plugins and dependencies as additional lib\n\nFolder `/jmeter/additional/lib` is used as additional lib folder for JMeter and `/jmeter/additional/lib/ext` is used as\nadditional folder for lib/ext folder in JMeter, files on those folders are not copied.\n\nExample of use:\n\nOn the host machine prepare folder `/mylib` with additional libraries and a sub folder ext with plugins:\n\n```sh\ndocker run --rm \\\n-v ${PWD}/tests/projects/sample1/:/jmeter/project \\\n-v /mylib/:/jmeter/additional/lib  \\\n-e JMETER_JMX=\"test-plan.jmx\" \\\nanasoid/jmeter:latest-plugins\n```\n\n# Test plan check\n\nUse [version with plugins](#jmeterjmeter-version-plugins-) to have pre-configured test plan check.\n[Test plan check tool](https://jmeter-plugins.org/wiki/TestPlanCheckTool/) can verify test plan without executing test.\n\nFor example:\n\n```sh\ndocker run --rm \\\n-v ${PWD}/tests/projects/sample1/:/jmeter/project \\\n-e JMETER_JMX=\"test-plan.jmx\" \\\n-e JMETER_CHECK_ONLY=\"true\" \\\nanasoid/jmeter:latest-plugins\n```\n\n**N.B** Test plan check can't detect plugins in additional folder,\nso [Use plugins and dependencies as additional lib.](#use-plugins-and-dependencies-as-additional-lib) will not work with\ntest check even it work with execution.\n\n# Split CSV files\n\nOften we need that JMeter cluster doesn't use duplicated data (like logged user, ...). This can be achieved by splitting\nCSV files on the number of slaves.\n\nTo do this you can follow the following steps:\n\n1. You have to identify CSV files that you want to be divided using a pattern `CONF_CSV_SPLIT_PATTERN`, for example use\n   a prefix on all files (\\*\\_split.csv: login_split.csv)\n1. You have to know the total number of slaves `CONF_EXEC_WORKER_COUNT` and identify each slave by\n   number `CONF_EXEC_WORKER_NUMBER`.\n1. CSV file will be replaced by the divided one. If project folder should not be modified, use option copy to workspace\n   space `CONF_COPY_TO_WORKSPACE`, to duplicate project folder before starting execution.\n1. You can also copy the divided files to out folder for debugging reasons to check divided\n   data `CONF_CSV_DIVIDED_TO_OUT`\n\nFor example:\n\n```sh\ndocker run --rm \\\n-v ${PWD}/tests/projects/sample1/:/jmeter/project \\\n-e JMETER_JMX=\"test-plan.jmx\" \\\n-e CONF_COPY_TO_WORKSPACE=\"true\" \\\n-e CONF_EXEC_WORKER_COUNT=\"5\" \\\n-e CONF_EXEC_WORKER_NUMBER=\"1\" \\\n-e CONF_CSV_SPLIT_PATTERN=\"**_split.csv\"\n-e CONF_CSV_DIVIDED_TO_OUT=\"true\" \\\nanasoid/jmeter:latest\n```\n\n# Timezone\n\nDefault timezone is GMT, if you need to change timezone to have correct time on jmeter log, you can set environment\nvariables **TZ**, list of timezone are available here \u003chttps://en.wikipedia.org/wiki/List_of_tz_database_time_zones\u003e.\n\nExample to change timezone :\n\n```sh\ndocker run --rm \\\n-v ${PWD}/tests/projects/sample1/:/jmeter/project \\\n-e JMETER_JMX=\"basic-plan.jmx\" \\\n-e TZ=\"Africa/Casablanca\" \\\nanasoid/jmeter:latest\n```\n\nTimezone can also changed in file before-test.sh\n\n```sh\n\nexport TZ=\"Africa/Casablanca\"\n\n```\n\n# JMX Monitoring (Jolokia)\n\nEnable Jolokia for Jmx monitoring, on port 8778, it's mandatory to use jdk version image with Jolokia.\n\n```sh\ndocker run --rm \\\n-p 8778:8778\n-v ${PWD}/tests/projects/sample1/:/jmeter/project \\\n-e JMETER_JMX=\"basic-plan.jmx\" \\\n-e CONF_WITH_JOLOKIA=\"true\" \\\nanasoid/jmeter:latest-plugins-11-jdk\n```\n\n# Examples\n\n## Change JVM Memory size\n\nYou can change memory size using `JMETER_JVM_ARGS` or `JMETER_JVM_EXTRA_ARGS`, e.g. :\n\n```sh\ndocker run --rm \\\n-v ${PWD}/tests/projects/sample1/:/jmeter/project \\\n-e JMETER_JMX=\"basic-plan.jmx\" \\\n-e JMETER_JVM_ARGS=\" -Xmx2G -Xms1G \" \\\nanasoid/jmeter:latest\n```\n\n## Use additional properties files\n\nYou can add additional properties files using `JMETER_PROPERTIES_FILES`. Default value is jmeter.properties (If a file\n_jmeter.properties_ is found in [project folder](#project-folder-structure) or in [user folder](#user-folder-structure)\nit will be added to JMeter execution.).\n\n```sh\ndocker run --rm \\\n-v ${PWD}/tests/projects/sample1/:/jmeter/project \\\n-e JMETER_JMX=\"test-plan.jmx\" \\\n-e JMETER_PROPERTIES_FILES=\" common.properties prepord.properties \" \\\nanasoid/jmeter:latest\n```\n\n## Use timeout for JMeter execution\n\nYou can set a timeout for execution by value of `CONF_EXEC_TIMEOUT`. After that timeout JMeter is stopped and after that\nthe container will be stopped also. The timeout is useful on cloud infrastructure when docker container has a cost. If\nfor any reason the test is not started, the slave will shutdown after timeout. Timeout value should be bigger by a good\nmargin than the time needed by the test to not be stopped during execution.\n\nFor example: timeout of 1 hour\n\n```sh\ndocker run --rm \\\n-v ${PWD}/tests/projects/sample1/:/jmeter/project \\\n-e JMETER_JMX=\"test-plan.jmx\" \\\n-e CONF_EXEC_TIMEOUT=\"3600\" \\\nanasoid/jmeter:latest\n```\n\n## Execute before-test.sh/after-test.sh only on master node\n\nbefore-test.sh/after-test.sh are executed on all nodes, but you can add conditions in a script file to test if a block\nof code should be executed.\n\nFor example: timeout of 1 hour\n\n```sh\n   if [[ \"$CONF_EXEC_IS_SLAVE\" == \"true\" ]]; then\n     # Slave block\n     else\n     # Master block\n   fi\n\n```\n\n## Generate JTL, HTML report and log file\n\nOutput base folder is pre-configured as `/jmeter/out`, you can choose name of report `JMETER_REPORT_NAME` which will be\nstored in `/jmeter/out/dashboard` and JTL file name `JMETER_JTL_FILE` which will be stored in `/jmeter/out/jtl/` and\njmeter log file (default jmeter.log) `JMETER_LOG_FILE` which will be stored in `/jmeter/out/log/`.\n\nFor example: generate JTL and dashboard with a name chosen as _myreport_\n\n```sh\ndocker run --rm \\\n-v ${PWD}/tests/projects/sample1/:/jmeter/project \\\n-e JMETER_JMX=\"basic-plan.jmx\" \\\n-e JMETER_JTL_FILE=out.jtl \\\n-e JMETER_LOG_FILE=out.log \\\n-e JMETER_REPORT_NAME=myreport \\\nanasoid/jmeter:latest\n```\n\nJTL file will be in `/jmeter/out/jtl/out.jtl`, report folder will be in `/jmeter/out/dashboard/myreport` and JMeter log\nwill be in `/jmeter/out/log/out.log`\n\n## Using additional raw JMeter parameter\n\nArguments passed to docker container are finally passed to JMeter, so you can use any additional arguments\n\nFor example: disable RMI SSL, and add custom properties `numberthread`\n\n```sh\ndocker run --rm \\\n-v ${PWD}/tests/projects/sample1/:/jmeter/project \\\n-e JMETER_JMX=\"basic-plan.jmx\" \\\n-e JMETER_JTL_FILE=out.jtl \\\n-e JMETER_LOG_FILE=out.log \\\n-e JMETER_REPORT_NAME=myreport \\\nanasoid/jmeter:latest -Jserver.rmi.ssl.disable=true -Jnumberthread=500\n```\n\n## Using raw JMeter parameter\n\nThe pre-configured folder structure can be ignored, and JMeter can be used as standard way.\n\nThe following arguments will be added by default:\n\n1. `--nongui` from `JMETER_DEFAULT_ARGS`\n2. ' --jmeterlogfile /jmeter/out/log/jmeter.log' from value `JMETER_LOG_FILE`, if `JMETER_LOG_FILE` is empty or a\n   custom `--jmeterlogfile` or `-j` to have new JMeter log file this arguments will be not add to JMeter.\n\n```sh\ndocker run --rm \\\n-v ${PWD}/tests/projects/sample1/:/myproject \\\nanasoid/jmeter:latest -t /myprojet/test.jmx -Jthread=50 -q /myproject/prop.properties\n```\n\n## Using wait to be Ready\n\nContainer can be started and wait until ready fie will be present.\n\nThe following arguments will be added by default:\n\n1. `--nongui` from `JMETER_DEFAULT_ARGS`\n2. ' --jmeterlogfile /jmeter/out/log/jmeter.log' from value `JMETER_LOG_FILE`, if `JMETER_LOG_FILE` is empty or a\n   custom `--jmeterlogfile` or `-j` to have new JMeter log file this arguments will be not add to JMeter.\n\n```sh\ndocker run --name jmeter \\\n-e CONF_READY_WAIT_FILE=\"ready.txt\" \\\n-e JMETER_JMX=\"basic-plan.jmx\" \\\n anasoid/jmeter:latest\n\n #Copy test to container\n docker cp ${PWD}/tests/projects/sample1/basic-plan.jmx jmeter:/jmeter/project\n\n#Start test by creation of file ready.txt\n docker exec jmeter touch /jmeter/project/ready.txt\n\n```\n\n# Best Practice\n\n1. Use container instance by execution.\n2. Force exit container after execution, use `JMETER_EXIT` to force remote exit after test execution.\n3. In environment when container has a cost (like AWS Fargate, Azure container instance, Google cloud run) and there is\n   a risk of JMeter not stopping correctly (for any reason like slaves are started but master fail, ...), than use\n   timeout execution `CONF_EXEC_TIMEOUT` in seconds. Be careful, timeout should be greater than the max duration\n   possible for test.\n4. Adapt memory needed by the JVM using `JMETER_JVM_ARGS` and don't use a huge Memory instance, it's preferable to have\n   smallest one: less than 8GB.\n5. Always use properties to parameterize\n   tests (\u003chttps://jmeter.apache.org/usermanual/best-practices.html#parameterising_tests\u003e), than you can save multi\n   pre-configured properties files to be used with `JMETER_PROPERTIES_FILES`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanasoid%2Fdocker-jmeter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanasoid%2Fdocker-jmeter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanasoid%2Fdocker-jmeter/lists"}