{"id":13566594,"url":"https://github.com/Rbillon59/jmeter-docker-compose-starterkit","last_synced_at":"2025-04-04T00:31:17.292Z","repository":{"id":46923825,"uuid":"331780511","full_name":"Rbillon59/jmeter-docker-compose-starterkit","owner":"Rbillon59","description":null,"archived":false,"fork":false,"pushed_at":"2023-09-25T07:22:31.000Z","size":47214,"stargazers_count":38,"open_issues_count":0,"forks_count":27,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-04T20:42:44.367Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Rbillon59.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-01-21T23:16:29.000Z","updated_at":"2024-10-11T16:24:03.000Z","dependencies_parsed_at":"2024-08-01T13:39:23.278Z","dependency_job_id":null,"html_url":"https://github.com/Rbillon59/jmeter-docker-compose-starterkit","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rbillon59%2Fjmeter-docker-compose-starterkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rbillon59%2Fjmeter-docker-compose-starterkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rbillon59%2Fjmeter-docker-compose-starterkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rbillon59%2Fjmeter-docker-compose-starterkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rbillon59","download_url":"https://codeload.github.com/Rbillon59/jmeter-docker-compose-starterkit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247103306,"owners_count":20884023,"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":[],"created_at":"2024-08-01T13:02:12.673Z","updated_at":"2025-04-04T00:31:16.971Z","avatar_url":"https://github.com/Rbillon59.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"# JMeter dockerized template repository\n\n## JMeter version\n\nThe JMeter image used is the \u003chttps://hub.docker.com/r/rbillon59/jmeter-k8s-base\u003e\nEach tag of that Docker image is a JMeter version\n\nTo use a specific version, just change the JMETER_VERSION env var in the `docker-compose.yaml` file\n\n```yaml\n  jmeter-master:\n    build: \u0026common-build\n      context: .\n      args:\n        - JMETER_VERSION=5.4.1\n```\n\nThese images are based on openjdk 16 and are compatible for x86_64 and arm64 architectures\n\n## How to use it\n\nBe sure to have Docker up and ready on your host and docker-compose installed\n\nCreate a repository from this template\nthen clone it with :\n\n```shell\ngit clone \u003cREPO\u003e \n```\n\n### Prerequisites\n\n#### File structure\n\n- You need to put your JMeter project folder inside the `scenario` folder, **inside a folder named after the JMX (without the extension)**. See example tree below\n- Put your CSV file inside the `data` folder, child of `scenario`\n- Put your JMeter modules (include controlers) inside the `modules` folder, child of `scenario`\n- Set the scenario variables in the project's folder `.env` file. These variables will be exported and usable inside your scenario as Jmeter properties `${__P()}` (see scenario/my-scenario/my-scenario.jmx example)\n- In the `.env` file at the repo root. Just set the name of the JMeter project to run. Like `JMX_FOLDER=my-scenario`\n\n\u003e `data`and `modules` are in the `scenario` folder and not below inside the `\u003cproject\u003e` folder because, in some cases, you can have multiple JMeter projects that are sharing the JMeter modules (that's the goal of using modules after all).\n\nBelow a visual representation of the file structure\n\n```bash\n+-- .env\n+-- scenario\n|   +-- data\n|   +-- modules\n|   +-- my-scenario\n|       +-- my-scenario.jmx\n|       +-- .env\n```\n\n#### In JMeter\n\nIn JMeter just put the filename in the path of your `CSV Data Set Config` : Be sure your filename have a .csv suffix (in lowercase)\n\nDo the same for the `Include Controller`, just use the filename without any path (with the extension)\n\n### Runtime\n\nTo launch your test in a one liner fashion :\n\n```shell\nsource scenario/my-scenario/.env \u0026\u0026 sudo docker-compose -p jmeter up --scale jmeter-slave=${nbInjector} -d\n```\n\n- Sourcing the `.env` will give you the ability to use $nbInjector in the docker-compose command line. (optionnal)\n- The *-p jmeter* is mandatory to prefix the docker-compose created networks and containers to work together (Tips : **For every docker-compose command, use -p jmeter**)\n- The scale command is used to create the necessary amount of slaves injectors\n\n\u003e :warning: Use the `-p jmeter` option for every docker-compose command\n\nYou can visualize your performance test on host:30000 with the grafana attached. (login: admin password: admin)\n\nAt the end of the test, JMeter will create a report in the `report/your-scenario` directory\n\nWhen you are done you can do\n\n```shell\ndocker-compose -p jmeter down\n```\n\nto shutdown influxdb, grafana as well\n\nTips :\n\n- Your influxdb data are persisted in the influx-grafana folder, so you can relaunch a test with your historical data on it.  \n- If you need to update your JVM configuration, you can update the environment variables in the docker compose file\n- If you specified hosts / ports / protocol etc.. directly in jour jmx, the environment variable will ***NOT*** override them.\n- You can run a multi injector test by changing your .env file with nbInjector=X with the number of injectors you will need  \n- The number of threads defined in the .env file is ***Per Injectors***\n\n## Options\n\nOptions can be set in the **.env file of your project**\n\n`XMX` optional : Set the java heap (default 1g)  \n`XMS` optional : Set the java heap (default 1g)  \n`host` optional : Set the default request hostname on which perform the test (default jsonplaceholder.typicode.com)  \n`port` optional : Set the default request port on which perform the test (default 443)  \n`protocol` optional : Set the default request protocol (default https)  \n`threads` optional : Set the number of virtual users to create (default 10)  \n`duration` optional : Set the duration of the test in seconds (default 600)  \n`rampup` optional : Set the time needed to create the total threads number (dafault 60)  \n`nbInjector` optional : Set the number of injectors needed to run the test (default 1)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRbillon59%2Fjmeter-docker-compose-starterkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRbillon59%2Fjmeter-docker-compose-starterkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRbillon59%2Fjmeter-docker-compose-starterkit/lists"}