最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

jmeter - Distribute the Threads Across the Duration - Stack Overflow

programmeradmin1浏览0评论

I am new to JMeter so apologies for my ignorance. I have a load testing script which has the following configuration. When I ran it using the JMeter GUI, the 107 threads were used in a span of 2 minutes. However, what I want to achieve is to distribute the 107 threads across the total duration (120 ramp up + 780 duration), which means 7 threads per minute.

<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Batch1-PolicyQUA">
    <intProp name="ThreadGroup.num_threads">107</intProp>
    <intProp name="ThreadGroup.ramp_time">120</intProp>
    <longProp name="ThreadGroup.duration">780</longProp>
    <longProp name="ThreadGroup.delay">5</longProp>
    <boolProp name="ThreadGroup.same_user_on_next_iteration">false</boolProp>
    <boolProp name="ThreadGroup.scheduler">true</boolProp>
    <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
    <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller">
      <stringProp name="LoopController.loops">1</stringProp>
      <boolProp name="LoopController.continue_forever">false</boolProp>
    </elementProp>
</ThreadGroup>

Is it possible to achieve this behavior?

I am new to JMeter so apologies for my ignorance. I have a load testing script which has the following configuration. When I ran it using the JMeter GUI, the 107 threads were used in a span of 2 minutes. However, what I want to achieve is to distribute the 107 threads across the total duration (120 ramp up + 780 duration), which means 7 threads per minute.

<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Batch1-PolicyQUA">
    <intProp name="ThreadGroup.num_threads">107</intProp>
    <intProp name="ThreadGroup.ramp_time">120</intProp>
    <longProp name="ThreadGroup.duration">780</longProp>
    <longProp name="ThreadGroup.delay">5</longProp>
    <boolProp name="ThreadGroup.same_user_on_next_iteration">false</boolProp>
    <boolProp name="ThreadGroup.scheduler">true</boolProp>
    <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
    <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller">
      <stringProp name="LoopController.loops">1</stringProp>
      <boolProp name="LoopController.continue_forever">false</boolProp>
    </elementProp>
</ThreadGroup>

Is it possible to achieve this behavior?

Share Improve this question asked Mar 6 at 10:33 SohlaeSohlae 7901 gold badge13 silver badges39 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 0

If you want to add 7 users each minute you need to set the ramp-up time to be equal to the whole duration of the test - 900 seconds.

Also you might find i.e. Ultimate Thread Group or https://jmeter-plugins./wiki/SteppingThreadGroup/ easier to use as they provide more flexible configuration options and show the workload model chart.

More information: A Guide to JMeter Thread Group

<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Batch1-PolicyQUA">
    <intProp name="ThreadGroup.num_threads">107</intProp>
    <intProp name="ThreadGroup.ramp_time">900</intProp> <!-- Total duration (120+780) -->
    <longProp name="ThreadGroup.duration">900</longProp> <!-- Same as ramp-up to cover full span -->
    <longProp name="ThreadGroup.delay">5</longProp>
    <boolProp name="ThreadGroup.same_user_on_next_iteration">false</boolProp>
    <boolProp name="ThreadGroup.scheduler">true</boolProp>
    <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
    <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller">
      <stringProp name="LoopController.loops">1</stringProp>
      <boolProp name="LoopController.continue_forever">false</boolProp>
    </elementProp>
</ThreadGroup>
发布评论

评论列表(0)

  1. 暂无评论