Outline

  • Test Plan
  • Test Group
  • Controllers
  • Listeners
  • Timers

Test Plan

Test Plan is the root element JMeter structure and it contains other elements like Threads, Timers, Assertions, Listeners.

test_plan

Thread Group

Thread Group is used for specifying number of running threads, ramp-up period and loop count. It represents group of users will execute a particular testcase.

thread group

Number of Threads (Users) simulates the number of users or connections to your server application.

Loop Count means how many times to execute the test.

Ramp-up defines how long it will take JMeter to get all threads running. For example , if there are 6 threads and ramp-up period is 60 seconds, then each thread will delay (60/6) 10 seconds. After 60 seconds, all threads will run.

ThreadGroup_ramp_up

Scheduler check-box means that your test will not be executed until start date.

jmeter_schedular

Controllers

JMeter has 2 types  controllers Sampler and Logical controllers.

Sampler:  JMeter provides different requests to send them to the server. We can  change and configure all these samplers.

Default sampler  list:

default_samplers

Logical: which help you to customize your request  logic. You can find  latest logical controllers list provided by JMeter.

logic_controllers

Listeners

Let us see results of test in different formats. Lets gather the data and analyze the results of tests.

If you click on “Configure” button

listener_result

Provides different formats to save results (CSV, XML)

You can change the default format, find the following line in jmeter.properties:

jmeter.save.saveservice.output_format=

Listeners  collect data only from elements at their below elements.

By default, the results are stored as XML files, typically with a “.jtl” extension.

results_tree

Listeners can use lots of memory so they should not be used in real tests. It is better to use them only for debugging.

Keep in mind that there some suggestions on reducing resource usage in JMeter official website.

  • Use non-GUI mode: jmeter -n -t test.jmx -l test.jtl
  • Use as few Listeners as possible; if using the -l flag as above they can all be deleted or disabled.
  • Don’t use “View Results Tree” or “View Results in Table” listeners during the load test, use them only during scripting phase to debug your scripts.
  • Rather than using lots of similar samplers, use the same sampler in a loop, and use variables (CSV Data Set) to vary the sample.
[The Include Controller does not help here, as it adds all the test elements in the file to the test plan.]
  • Don’t use functional mode
  • Use CSV output rather than XML
  • Only save the data that you need
  • Use as few Assertions as possible
  • Use the most performing scripting language (see JSR223 section)  (jmeter.apache.org)
  • Timers

    JMeter sends requests without any pause between each request by default. Thus, timers make test scenarios more realistic, they pause every request certain amount time. In below figure you can see that there is a 3000 ms delay between two request.

    timers