Skip to content

A unique plugin to control Jmeter using REST APIs during the run.

License

Notifications You must be signed in to change notification settings

rollno748/JMeter-OnFlyUpdater

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JMeter-OnFlyUpdater

Introduction

JMeter plugin to control Jmeter during the running status. This plugin adds feature to control jmeter over REST APIs

Required Components

  1. Jmeter
  2. Postman/cURL

Features

  • Get Plugin active status
  • Get Jmeter user status (active/running/stopped)
  • Get the list of properties from the running Jmeter (System/Jmeter)
  • Update one or more properties to running Jmeter (System/Jmeter)
  • Update Logger type to running Jmeter (OFF/FATAL/ERROR/WARN/INFO/DEBUG/TRACE/ALL)
  • Get All the threads info
  • Add/Remove users/threads to specific threadgroup(s). Supports multiple updation at single call
  • Get info releated to specific threadgroup(s)
  • Update info to specific threadgroup(s)
  • Get list of variables from one or more threads
  • Update variables to one or more threads
  • Get elements from the running test (Listeners)
  • Enable/Disable elements to the running test (ThreadGroups/Listeners/ConfigElements etc)
  • Stops the test - Supports both gradual and abrupt
  • Get Slaves Info
  • Send Stop signals to specific/all slaves

Jar Dependencies Required

  • spark-core-2.8.0.jar
  • gson-2.2.4.jar

Jmeter Target

  • Jmeter version 5.1.1 or above
  • Java 8 or above

Installation Instructions

  • Download the source code from the Github.
  • Just do a mvn clean install (Git bash is required)
  • Jar will be generated under the target directory (jmeter-onfly-updater-0.1.jar)
  • Copy the Jar to \<Jmeter Installed Directory\>/lib/ext/

How to use it

Add required config element (On-Fly-Updater config)

  • Set a password for authentication (Default password will be Upd@t3M3)
  • Set the Port number on which the Spark Services to run (Optional, Defaults to 1304)
  • Set the URI path (Optional, Defaults to /on-fly)
  • Once the test started, the Spark server will start a REST server according to the config provided. The default will be http://127.0.0.1:1304/on-fly/
  • The Rest services supported are as follows. e.g; http://localhost:1304/on-fly/ping
  • The On-Fly Updater will have a credentials based control to the REST services. It requires a password header to be passed with the REST services.

Supported REST Services

Service HTTP Method URI QueryParams ReqBody Status
PluginRunningStatus GET /{URI-PATH}/ping NA Completed
GetStatus GET /{URI-PATH}/status NA Completed
SetLogger PUT /{URI-PATH}/logger/{logType} WARN/ERROR/DEBUG/OFF Completed
GetProperties GET /{URI-PATH}/properties?type={type} jmeter/system Completed
UpdateProperties PUT /{URI-PATH}/properties NA Completed
GetThreads GET /{URI-PATH}/threads NA Completed
UpdateThreads PUT /{URI-PATH}/threads NA Completed
GetThreadGroupsList PUT /{URI-PATH}/threadgroups NA Completed
UpdateThreadGroups PUT /{URI-PATH}/threadgroups NA Completed
GetJmeterVariables GET /{URI-PATH}/vars NA Completed
UpdateJmeterVariables PUT /{URI-PATH}/vars NA Completed
GetElements GET /{URI-PATH}/elements NA Completed
UpdateTestElement PUT /{URI-PATH}/elements NA Not Started
StopTest POST /{URI-PATH}/stoptest?action={action} shutdown/stop Completed
Slaves GET /{URI-PATH}/slaves NA Completed
StopTest-Slaves POST /{URI-PATH}/slaves/stoptest?action={action} shutdown/stop Needs Validation

Additional Info

Some more info on the plugin

  • The REST services will be active only during the test. The End of test will terminate the REST services
  • Plugin Running status also initialised during the test
  • Observed some abnormal behavior on the plugin when the test is restarted without killing the JMeter JVM

Known Issues

  • Updating thread groups is working, response is not retrieved from the server
  • Updating test element in the testplan is not working
  • Sending signals to slaves is not working

References

Tools Used

💲 Donate

💲 Support Me

If this project help you reduce time to develop, you can give me a cup of coffee :)

paypal

Please rate a 🌟 if you like it / benefits you.

Please open up a 🪲 - If you experienced something.