JM Scripts

JMeter Scripting Guidelines for this Solution

The scope of this page will not cover general JMeter scripting lessons as there is plenty of support out on the net. Rather, I will cover those areas relevant to this solution. There are just a few guidelines to follow here.

Injector Id

The controller will place a file on each injector that gives the injector id and the total number of injectors. Thus if we have 10 injectors and you are on injector number 4, the file (injector.properties) will read 4,10. The file is placed in the same directory as the jmeter script.

The injector Id is provided so you can manipulate data in your script, in particular splitting data files to cover unique data across all virtual users

In the example script included I have gone a bit over the top with reading this file (using my general ‘read a line from a file’ groovy routine I got off the net). And I have written out the injector number and total to file. This was just as a test for my script and is not generally needed. Here’s the code:

scripts1

By the way, the above script uses groovy:

scripts2

Name your scripting steps

For the purposes of later analysis (see the JM 95th page) you need to give unique names to your script samplers. These names are reflected in the final results data files:

scripts3

Results data files

Name your results data files carefully and uniquely.

    The filename should include ‘results’

    The file ending should be either .csv or .xml

These conventions are needed for this solution. See the JM Results page for more info.

(.csv files must be configured to not ‘Save As XML’)

scripts4

scripts5

Input data files

Input data files can be placed locally at a relative path to the jmeter script, which allows you to test locally with relative ease. These files will be moved by the controller and placed in the /data folder on the injector. (I was using /data locally as well)

scripts6

Assertions

JMeter assertions can now be used for checking responses for functional errors under load (a basic requirement for anything above simply unit performance testing).

Guidelines for these are on the dedicated Assertions page.

[Home] [About (CV)] [Contact Us] [JMeter Cloud] [JM Highlights] [JM Overview] [JM Control] [JM Inject] [JM Threads] [JM Results] [JM Assertions] [JM TPS] [JM Metrics] [JM Runtime] [JM Collation] [JM Logs] [JM 95th] [JM 95th v2] [JM Jenkins] [JM Corporate] [JM Scripts] [JM Variables] [JM Embedded] [JM Hosts] [JM Running] [JM Example] [JM Versions] [webPageTest] [_64 images] [asset moniitor] [Linux Monitor] [Splunk ETL] [Splunk API] [AWS bash] [LR Rules OK] [LR Slave] [LR CI Graphs] [LoadRunner CI] [LR CI Variables] [LR Bamboo] [LR Methods] [LR CI BASH] [Bash methods] [Jenkins V2] [Streaming vid] [How fast] [Finding Issues] [Reporting] [Hand over] [VB Scripts] [JMeter tips] [JMeter RAW] [Dynatrace] [Documents] [FAQ] [Legal]

In the Cartesian Elements Ltd group of companies