在测试计划中,我创建了一个如下配置的线程组:
1.发生采样器错误后要采取的措施:继续
2.线程数(用户):10000
3.加速周期(以秒为单位):1
4.循环计数:1
5.持续时间(秒):2
6.启动延迟(秒):10
线程组中有一个Http Request Sampler。
运行测试计划后,在jmeter.log
2019-04-30 15:46:01,558 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 1 : Thread Group-WB
2019-04-30 15:46:01,558 INFO o.a.j.e.StandardJMeterEngine: Starting 10000 threads for group Thread Group-WB.
2019-04-30 15:46:01,558 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error
2019-04-30 15:46:01,559 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=10000 ramp-up=1 delayedStart=false
2019-04-30 15:46:06,549 INFO o.a.j.t.ThreadGroup: Started thread group number 1
2019-04-30 15:46:06,549 INFO o.a.j.e.StandardJMeterEngine: All thread groups have been started
2019-04-30 15:46:11,559 INFO o.a.j.t.JMeterThread: Thread started: Thread Group-WB 1-1
2019-04-30 15:46:11,562 INFO o.a.j.t.JMeterThread: Thread started: Thread Group-WB 1-2
2019-04-30 15:46:11,614 INFO o.a.j.t.JMeterThread: Thread started: Thread Group-WB 1-67
...
2019-04-30 15:46:15,541 INFO o.a.j.t.JMeterThread: Thread started: Thread Group-WB 1-5884
2019-04-30 15:46:15,541 INFO o.a.j.t.JMeterThread: Thread started: Thread Group-WB 1-5890
2019-04-30 15:46:15,541 INFO o.a.j.t.JMeterThread: Thread started: Thread Group-WB 1-5891
...
2019-04-30 15:46:15,367 INFO o.a.j.t.JMeterThread: Thread started: Thread Group-WB 1-7239
...
2019-04-30 15:46:21,913 INFO o.a.j.t.JMeterThread: Thread is done: Thread Group-WB 1-8506
2019-04-30 15:46:21,912 INFO o.a.j.t.JMeterThread: Thread finished: Thread Group-WB 1-8505
...
2019-04-30 15:46:16,872 INFO o.a.j.t.JMeterThread: Thread started: Thread Group-WB 1-8042
2019-04-30 15:46:16,872 INFO o.a.j.t.JMeterThread: Thread started: Thread Group-WB 1-8041
2019-04-30 15:46:18,767 INFO o.a.j.t.JMeterThread: Stopping because end time detected by thread: Thread Group-WB 1-7239
2019-04-30 15:46:18,767 INFO o.a.j.t.JMeterThread: Thread is done: Thread Group-WB 1-7239
2019-04-30 15:46:18,767 INFO o.a.j.t.JMeterThread: Thread finished: Thread Group-WB 1-7239
...
2019-04-30 15:47:35,716 INFO o.a.j.t.JMeterThread: Thread is done: Thread Group-WB 1-9783
2019-04-30 15:47:35,716 INFO o.a.j.t.JMeterThread: Thread finished: Thread Group-WB 1-9783
2019-04-30 15:47:36,941 INFO o.a.j.t.JMeterThread: Stopping because end time detected by thread: Thread Group-WB 1-1037
2019-04-30 15:47:36,942 INFO o.a.j.t.JMeterThread: Thread is done: Thread Group-WB 1-1037
2019-04-30 15:47:36,942 INFO o.a.j.t.JMeterThread: Thread finished: Thread Group-WB 1-1037
2019-04-30 15:47:36,944 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test
2019-04-30 15:47:36,945 INFO o.a.j.g.u.JMeterMenuBar: setRunning(false, *local*)
第一个Thread Group-wisebuy 1-1开始于2019-04-30 15:46:11,559
我将加速时间设置为1秒,为什么线程组明智购买1-5891开始于2019-04-30 15:46:15,541?
我将Duration设置为2秒,为什么Thread Group-wisebuy 1-7239在2019-04-30 15:46:18,767停止?
答案 0 :(得分:0)
加速期告诉JMeter需要多长时间来“加速”到所选的全部线程。如果使用了10个线程,并且启动周期为100秒,那么JMeter将花费100秒来启动和运行所有10个线程。每个线程将在上一个线程开始后10(100/10)秒开始。
通过将加速周期设置为仅1秒,您基本上是在告诉JMeter一次启动所有10,000个线程(即,尽可能快地启动)。
因此,线程1-5891在第一个线程之后不久就开始了。线程1-7239的开始时间大约为16秒,由于持续时间= 2秒,因此大约18秒结束。
如果您打算每秒启动1个用户,则可以将加速周期设置为每#个用户1秒(10,000秒)。