Jmeter - Counter Config Element With Example

Apache JMeter has many unlike configuration elements too counter is 1 of the configuration chemical part of JMeter. Counter config chemical part allows yous to laid a counter too thence yous tin laissez passer on the sack role it's reference anywhere inward your thread grouping of your software charge essay plan. Let's empathize how to add together too configure counter inward your software charge essay plan.

Add Counter In Test Plan
You tin laissez passer on the sack add together counter under Thread Group, Controller or Request every bit per your requirement. Let's add together it nether Simple Controller. To add together counter nether elementary controller of your software charge essay plan,
  • Right click on Simple Controller.
  • Select Add -> Config Element -> Counter. every bit shown inward bellow image.

It volition add together counter nether elementary controller.

Parameters of Counter Config Element
Counter config chemical part has many unlike parameters every bit shown inward bellow image. You tin laissez passer on the sack laid them every bit per your requirement.

  • Start : It represents the starting publish of counter during commencement iteration.
  • Increment : It represents how much yous wants to increment counter afterwards iteration. 
  • Maximum : Maximum how much counter tin laissez passer on the sack increase. Once achieve on maximum, It volition hold upward reset.
  • Format : This is optional field. i.e. 0000 volition format every bit 0001, 0002 etc.
  • Reference Name : Reference mention of this counter to role it in other elements. If laid Count as reference mention thence yous tin laissez passer on the sack role it every bit ${Count} inward other elements.
  • Track Counter Independently for each User : If cheque this checkbox thence each thread boot the bucket its ain counter during iterations. Means each thread gets independent count.
  • Reset counter on each Thread Group Iteration : If yous wants to reset count of counter at the terminate of iteration thence yous tin laissez passer on the sack laid it true.
Using Counter In Software Load Test
To run across how counter config chemical part genuinely works, Let's run across practical example.

Scenario : I convey prepared essay innovation amongst 1 asking "News Page" every bit shown inward bellow image. I wants to laid delay of 1 minute too it should increment yesteryear 1 minute on every iteration. Max delay should increment till v seconds.

We volition role counter to increment delay fourth dimension count on each iteration too use Constant Timer to laid delay. Constant Timer role usage Reference Name of counter every bit Thread delay.
  • Thread Group Config

Thread grouping properties are every bit shown inward in a higher house image. I convey laid Number of Threads = 1 too Loop Count = vi iterations.

Counter and Constant Timer config are every bit bellow.
  • Counter Config

You tin laissez passer on the sack run across that i convey laid Start = 1000, Increment = K too Maximum = 5000. So counter volition start amongst K too it volition increment K on each iteration. We volition role Count reference mention inward constant timer's thread delay textbox every bit shown inward bellow image.
  • Constant Timer Config

During 1st iteration thread delay volition hold upward K millisecond, During 2nd iteration thread delay volition hold upward 2000 millisecond, too thence on. So at the terminate of each iteration, thread delay volition increment yesteryear 1 minute till max v seconds.

When yous run test, effect volition looks similar bellow.


You tin laissez passer on the sack run across that Start Time divergence betwixt 1st too 2nd sample asking is nearest 1 second(Exclude Sample fourth dimension of 1st asking inward fourth dimension divergence calculation. i.e. Delay = 09:35:34.341 - 09:35:32.631 - 0.709 = 1 second.).

This is merely event of counter config chemical part to exhibit yous how it works. You tin laissez passer on the sack role it amongst whatsoever other elements of your software charge essay plan.

More interesting articles here :Generation Enggelmundus Internet Marketing Tool here :Zeageat IM http://www.software-testing-tutorials-automation.com/
Post a Comment (0)
Previous Post Next Post