Software Engineering Group

Using the Session Arrival Controller

Next: Running the Test Up: Using Markov4JMeter Previous: Creating User Behavior Models

Using the Session Arrival Controller


Figure 6: Example BeanShell script which returns the elapsed experiment minute as an integer using the Markov4JMeter variable TEST.START.MS.

he Session Arrival Controller controls the number of active sessions, given an expression evaluating to an integer value. It is configured within the configuration dialog of the Markov Session Controller. JMeter allows to use BeanShell 1 scripts within text expressions. Particularly, this allows for varying the number of active sessions depending on the elapsed experiment time. Markov4JMeter adds the global variable TEST.START.MS to the JMeter context which is accessible in BeanShell scripts. The variable is set when the Test Plan is started.

For example, when using the BeanShell script listed in Figure 6, the Session Arrival Controller limits the number of active sessions based on the elapsed experiment minute: in the i-th minute i active sessions are allowed in parallel. Figure 7 shows how to use this BeanShell script within the Session Arrival Controller configuration.


Figure 7: BeanShell scripts can be used with the function BeanShell. The BeanShell function source includes a script file.

The Session Arrival Controller doesn’t create any new threads. It simply blocks threads in a queue in case the number of active sessions would exceed the given maximum number. Hence, the maximum number of active sessions is limited to the number of threads configured in the Thread Group.

If an error occurs while evaluating the active sessions formula, the entire test is aborted immediately. Details concerning this error are written to the file jmeter.log.

1 Note that the BeanShell Jar file is not included in the JMeter release. The file can be downloaded from and must be copied to the lib/opt/ directory of the JMeter installation. See for a description on how to use BeanShell scripts within JMeter expressions.

Next: Running the Test Up: Using Markov4JMeter Previous: Creating User Behavior Models

Upcoming Events

  • Sep 04, 2017 09:00 AM to Sep 05, 2017 06:00 PM Geneva, Switzerland SERENE 2017
Research Projects

  • more...

     ExplorVizLogo160x37[1].png    iobserve-logo-small    CloudMIG Xpress


    Future-Ocean-logo    kieker-logo       PubFlow


    teetime-logo   SpratGeRDI