- JMeter Cookbook
- Bayo Erinle
- 289字
- 2021-08-05 17:36:27
Using timers
By default, when test scripts are recorded in JMeter, they contain no pauses between page requests. This is sometimes known as the think time in test scripts. In reality though, most users will frequently pause for a duration of time on every page before moving on to another page in the application. In JMeter, the ways to achieve these pauses are through timers. JMeter comes with a wealth of timers to achieve this purpose.
How to do it…
In this recipe, we will show you how to mimic realistic user behaviors using the JMeter timers.
- Launch JMeter.
- Open the
ch1_add_timers.jmx
test script located in thescripts/ch1
directory. - Add Gaussian Random Timer by navigating to Test plan | Add | Gaussian Random Timer.
- Change Deviation (in milliseconds) from
100
to1000
. - Change Constant Delay Offset (in milliseconds) from
300
to500
. - Save and execute the test script.
How it works…
With our configuration, each thread will pause for a duration of 0.5
to 1.5
seconds after each request before proceeding to the next request. This is because we applied the timer at the root level of the test plan. If we wanted to have pauses after each logical page rendering, we will add a timer at the transaction controller level. This option is mostly what you will go with as a single rendered web page often consists of multiple requests.
There's more…
There are many more timers that come bundled with JMeter even through additional plugins that serve different purposes. There are timers that simulate constant delay, constant throughput, random delay, and so much more. Depending on your use case and what you are trying to simulate, you will choose one or several of these.
- 計算機信息技術(shù)基礎(chǔ)實驗與習(xí)題
- 大數(shù)據(jù)可視化
- 云計算與大數(shù)據(jù)應(yīng)用
- MySQL基礎(chǔ)教程
- 數(shù)據(jù)化網(wǎng)站運營深度剖析
- 數(shù)據(jù)革命:大數(shù)據(jù)價值實現(xiàn)方法、技術(shù)與案例
- Python金融實戰(zhàn)
- 深入淺出Greenplum分布式數(shù)據(jù)庫:原理、架構(gòu)和代碼分析
- 信息學(xué)競賽寶典:數(shù)據(jù)結(jié)構(gòu)基礎(chǔ)
- Python數(shù)據(jù)分析與挖掘?qū)崙?zhàn)(第3版)
- SAS金融數(shù)據(jù)挖掘與建模:系統(tǒng)方法與案例解析
- Scratch 2.0 Game Development HOTSHOT
- Oracle 11g數(shù)據(jù)庫管理員指南
- 數(shù)據(jù)挖掘與數(shù)據(jù)化運營實戰(zhàn):思路、方法、技巧與應(yīng)用
- Python金融數(shù)據(jù)挖掘與分析實戰(zhàn)