Skip to content

A JMeter plugin to integrate the Elastic APM into JMeter script

Notifications You must be signed in to change notification settings

vdaburon/elastic-apm-jmeter-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

elastic apm jmeter logo

Apache JMeter tool plugin to Manage the integration of Elastic Application Performance Monitoring in a JMeter script.

Link to github project elastic-apm-jmeter-plugin

Apache JMeter tool plugin to manage the Elastic Application Performance Monitoring (ELASTIC APM) in JMeter script

GUI interface in the JMeter Tools Menu

This tool is present in the Menu Tools > ELASTIC APM Integration Tool

Menu Tools

When you click and the menu line "ELASTIC APM Integration Tool", the tool GUI is display

Menu Tools

Parameters

Parameters are :

  • file_in the JMeter script to read
  • file_out the file result, if the text field is empty then the file_out is the file name of file_in without the extension with suffix "_modif.jmx"
    e.g. file_in = script1.jmx, file_out is empty then file_out will be script1_modif.jmx
  • action = ADD or REMOVE,
    • ADD = Add "User Defined Variables for ELASTIC APM" and add "JSR223 groovy api apm call"
    • REMOVE = remove "User Defined Variables for ELASTIC APM" and remove "JSR223 groovy api apm call", the script will be as before action ADD
  • regex the regular expression matches the "Transaction Controller" label, if the label doesn't match the regular expression then NO "JSR223 groovy api apm" surround the "Transaction Controller"
    • default all = .* (this regular expression matches all labels)
    • e.g. regex = SC\d+_P.+ matches labels "SC01_P01_LOGIN" or "SC20_P12B_LOGOUT" or SC01_P01_LOGIN|SC02_P02_FIND|SC02_P012_LOGOUT for some Transaction Controllers

Button "MODIFY SCRIPT", this button launch the tool with parameters.

Status, the status line contains the tool status or the tool result.

e.g. : Status Results OK

  • Tool ELASTIC APM Integration Finished OK, ACTION = ADD, fileOut=C:\Temp\script1_add.jmx
  • Tool ELASTIC APM Integration Finished OK, ACTION = REMOVE, fileOut=C:\Temp\script1_add_modif.jmx

e.g. : Status Results KO

  • Tool ELASTIC APM Integration Finished KO, CAN'T READ jmx fileIn = C:\Temp\script1zzzz.jmx
  • Tool ELASTIC APM Integration Finished KO, exception = java.util.regex.PatternSyntaxException: Unmatched closing ')' near index 1 .*)
  • Tool ELASTIC APM Integration Finished KO, CAN'T CREATE or jmx file doesn't exist (look in the log file), fileOut = c:\toto (in log file : java.io.FileNotFoundException: c:\toto (Access denied) )

More documentation from jmeter-elastic-apm project

For more documentation (Architecture schema, kibana APM dashboard, JMeter script modified ...) look at README from jmeter-elastic-apm

Command line tool (CLI)

This tool could be use with script shell Windows or Linux.

Scripts shell are in <JMETER_HOME>/bin

  • elastic-apm-integrate.cmd for Windows OS
  • elastic-apm-integrate.sh for Linux/Mac OS

Help to see all parameters :

C:\apache-jmeter\bin>elastic-apm-integrate.cmd -help
usage: io.gihub.vdaburon.jmeter.elasticapmxml.ElasticApmJMeterManager -action <action> [-extract_end <extract_end>]
       [-extract_start <extract_start>] [-extract_udv <extract_udv>] -file_in <file_in> -file_out <file_out> [-help]
       [-regex <regex>]
io.soprasteria.vdaburon.jmeter.elasticapmxml.ElasticApmJMeterManager
 -action <action>                 action ADD or REMOVE, ADD : add groovy api call and REMOVE : remove groovy api call
 -extract_end <extract_end>       optional, file contains groovy end call api (e.g : extract_end.xml), default read file
                                  in the jar
 -extract_start <extract_start>   optional, file contains groovy start call api (e.g : extract_start.xml), default read
                                  file in the jar
 -extract_udv <extract_udv>       optional, file contains User Defined Variables (e.g : extract_udv.xml), default read
                                  file in the jar
 -file_in <file_in>               JMeter file to read (e.g : script.jmx)
 -file_out <file_out>             JMeter file modified to write (e.g : script_add.jmx)
 -help                            Help and show parameters
 -regex <regex>                   regular expression matches Transaction Controller Label (default .*) (e.g : SC[0-9]+_.
                                  for SC01_P01_HOME or SC09_P12_LOGOUT)
E.g : java -jar elastic-apm-jmeter-xml-<version>-jar-with-dependencies.jar -file_in script1.jmx -file_out script1_add.jmx
-action ADD -regex SC.*
E.g : java -jar elastic-apm-jmeter-xml-<version>-jar-with-dependencies.jar -file_in script1_add.jmx -file_out
script1_remove.jmx -action REMOVE -regex .*

e.g. action = ADD :

C:\apache-jmeter\bin>elastic-apm-integrate.cmd -file_in C:\temp\script1.jmx -file_out C:\temp\script1_add_cli.jmx -action ADD -regex SC.*

e.g. action = REMOVE :

/var/opt/apache-jmeter/bin>elastic-apm-integrate.sh -file_in /tmp/script1_add.jmx -file_out /tmp/script1_remove_cli.jmx -action REMOVE

Tool installed with jmeter-plugins-manager

This tool could be installed with the jmeter-plugins-manager from jmeter.plugins.org.
The tool name is : "vdn@github - elastic-apm-tool"

Usage Maven

The maven groupId, artifactId and version, this plugin is in the Maven Central Repository Maven Central elastic-apm-jmeter-plugin

<groupId>io.github.vdaburon</groupId>
<artifactId>elastic-apm-jmeter-plugin</artifactId>
<version>1.0</version>

Versions

version 1.0 first release