I have a similar need, so I cobbled together a special threadgroup to time my
actual 'test' threadgroups, and it can be used to time
the entire test plan as well... I'm not sure it would work well for the
individual thread execution times, but those are really
going to be measured by the number of iterations divided into the total thread
group time anyway. NOTE: this system really only
works if your threadgroups are run consecutively in the test plan - since the
timers have to run after each threadgroup runs... But
it is a start.
BTW, I totally agree with you - this is something that should be included in
the standard tools (e.g. fields in the summary report):
test execution elapsed time, and threadgroup execution elapsed time... The
'test execution elapsed time' needs to be a meta field in
the summary report - since it applies to the entire test. The 'threadgroup
execution elapsed time' needs to be an optional row added
to the summary report output that identifies the threadgroup name and elapsed
time.
Basically I add a threadgroup at the top of my test plan that gets the current
time in milliseconds since epoch. Then after each
threadgroup that is actually 'sampling' my system, I add another threadgroup
that updates the time elapsed with the current info.
If you save the below as a .jmx file, you can see what I'm talking about. Just
add your threadgroup between the two that are defined
already, and run a test - it will show you a timer row _before_ the first
thread group, and another _after_ the first thread group:
<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="2.2">
<hashTree>
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="TG Timer
Config" enabled="true">
<stringProp name="TestPlan.comments"></stringProp>
<boolProp name="TestPlan.functional_mode">false</boolProp>
<boolProp name="TestPlan.serialize_threadgroups">true</boolProp>
<elementProp name="TestPlan.user_defined_variables"
elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments"
testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments"/>
</elementProp>
<stringProp name="TestPlan.user_define_classpath"></stringProp>
<collectionProp name="TestPlan.thread_groups"/>
</TestPlan>
<hashTree>
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup"
testname="Start TG Timer" enabled="true">
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
<elementProp name="ThreadGroup.main_controller"
elementType="LoopController" guiclass="LoopControlPanel"
testclass="LoopController" testname="Loop Controller" enabled="true">
<boolProp name="LoopController.continue_forever">false</boolProp>
<stringProp name="LoopController.loops">1</stringProp>
</elementProp>
<stringProp name="ThreadGroup.num_threads">1</stringProp>
<stringProp name="ThreadGroup.ramp_time">0</stringProp>
<longProp name="ThreadGroup.start_time">1320342967000</longProp>
<longProp name="ThreadGroup.end_time">1320342967000</longProp>
<boolProp name="ThreadGroup.scheduler">false</boolProp>
<stringProp name="ThreadGroup.duration"></stringProp>
<stringProp name="ThreadGroup.delay"></stringProp>
</ThreadGroup>
<hashTree>
<UserParameters guiclass="UserParametersGui" testclass="UserParameters"
testname="User Parameters" enabled="true">
<collectionProp name="UserParameters.names">
<stringProp name="1185546556">PrevStartTime</stringProp>
<stringProp name="-1987142487">PrevTGCount</stringProp>
<stringProp name="0"></stringProp>
<stringProp name="1182835273">ElapsedTime</stringProp>
<stringProp name="-1999321243">threadStartTime</stringProp>
<stringProp name="-1409654180">tgCount</stringProp>
<stringProp name="1984987727">setTime</stringProp>
<stringProp name="647878586">setTGCount</stringProp>
</collectionProp>
<collectionProp name="UserParameters.thread_values">
<collectionProp name="-1834623057">
<stringProp
name="-2078679218">${__P(ThreadStartTime,0)}</stringProp>
<stringProp name="46204838">${__P(TGCount,1)}</stringProp>
<stringProp name="0"></stringProp>
<stringProp name="48">0</stringProp>
<stringProp name="1008029728">${__javaScript(var ms = new Date;
ms.getTime();)}</stringProp>
<stringProp name="49">1</stringProp>
<stringProp name="1759500564">${__setProperty(ThreadStartTime,
${threadStartTime})}</stringProp>
<stringProp name="-1525630572">${__setProperty(TGCount,
${tgCount})}</stringProp>
</collectionProp>
</collectionProp>
<boolProp name="UserParameters.per_iteration">false</boolProp>
</UserParameters>
<hashTree/>
<DebugSampler guiclass="TestBeanGUI" testclass="DebugSampler"
testname="TG ${tgCount} Start: ${threadStartTime} - Elapsed:
${ElapsedTime}" enabled="true">
<boolProp name="displayJMeterProperties">false</boolProp>
<boolProp name="displayJMeterVariables">false</boolProp>
<boolProp name="displaySystemProperties">false</boolProp>
</DebugSampler>
<hashTree/>
</hashTree>
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup"
testname="TG Timer" enabled="true">
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
<elementProp name="ThreadGroup.main_controller"
elementType="LoopController" guiclass="LoopControlPanel"
testclass="LoopController" testname="Loop Controller" enabled="true">
<boolProp name="LoopController.continue_forever">false</boolProp>
<stringProp name="LoopController.loops">1</stringProp>
</elementProp>
<stringProp name="ThreadGroup.num_threads">1</stringProp>
<stringProp name="ThreadGroup.ramp_time">0</stringProp>
<longProp name="ThreadGroup.start_time">1320342967000</longProp>
<longProp name="ThreadGroup.end_time">1320342967000</longProp>
<boolProp name="ThreadGroup.scheduler">false</boolProp>
<stringProp name="ThreadGroup.duration"></stringProp>
<stringProp name="ThreadGroup.delay"></stringProp>
</ThreadGroup>
<hashTree>
<UserParameters guiclass="UserParametersGui" testclass="UserParameters"
testname="User Parameters" enabled="true">
<collectionProp name="UserParameters.names">
<stringProp name="1185546556">PrevStartTime</stringProp>
<stringProp name="-1987142487">PrevTGCount</stringProp>
<stringProp name="0"></stringProp>
<stringProp name="1182835273">ElapsedTime</stringProp>
<stringProp name="-1999321243">threadStartTime</stringProp>
<stringProp name="-1409654180">tgCount</stringProp>
<stringProp name="1984987727">setTime</stringProp>
<stringProp name="647878586">setTGCount</stringProp>
</collectionProp>
<collectionProp name="UserParameters.thread_values">
<collectionProp name="-1451951225">
<stringProp
name="-2078679218">${__P(ThreadStartTime,0)}</stringProp>
<stringProp name="46204838">${__P(TGCount,1)}</stringProp>
<stringProp name="0"></stringProp>
<stringProp name="-1898455245">${__javaScript(var ms = new Date;
ms.getTime() - ${PrevStartTime};)}</stringProp>
<stringProp name="1008029728">${__javaScript(var ms = new Date;
ms.getTime();)}</stringProp>
<stringProp name="-1527117377">${__javaScript(${PrevTGCount} +
1)}</stringProp>
<stringProp name="1759500564">${__setProperty(ThreadStartTime,
${threadStartTime})}</stringProp>
<stringProp name="-1525630572">${__setProperty(TGCount,
${tgCount})}</stringProp>
</collectionProp>
</collectionProp>
<boolProp name="UserParameters.per_iteration">false</boolProp>
</UserParameters>
<hashTree/>
<DebugSampler guiclass="TestBeanGUI" testclass="DebugSampler"
testname="TG ${tgCount} Start: ${threadStartTime} - Elapsed:
${ElapsedTime}" enabled="true">
<boolProp name="displayJMeterProperties">false</boolProp>
<boolProp name="displayJMeterVariables">false</boolProp>
<boolProp name="displaySystemProperties">false</boolProp>
</DebugSampler>
<hashTree/>
</hashTree>
<ResultCollector guiclass="SummaryReport" testclass="ResultCollector"
testname="Summary Report" enabled="true">
<boolProp name="ResultCollector.error_logging">false</boolProp>
<objProp>
<name>saveConfig</name>
<value class="SampleSaveConfiguration">
<time>true</time>
<latency>true</latency>
<timestamp>true</timestamp>
<success>true</success>
<label>true</label>
<code>true</code>
<message>true</message>
<threadName>true</threadName>
<dataType>true</dataType>
<encoding>false</encoding>
<assertions>true</assertions>
<subresults>true</subresults>
<responseData>false</responseData>
<samplerData>false</samplerData>
<xml>true</xml>
<fieldNames>false</fieldNames>
<responseHeaders>false</responseHeaders>
<requestHeaders>false</requestHeaders>
<responseDataOnError>false</responseDataOnError>
<saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage>
<assertionsResultsToSave>0</assertionsResultsToSave>
<bytes>true</bytes>
</value>
</objProp>
<stringProp name="filename"></stringProp>
</ResultCollector>
<hashTree/>
</hashTree>
</hashTree>
</jmeterTestPlan>
--
Robin D. Wilson
Sr. Director of Web Development
KingsIsle Entertainment, Inc.
VOICE: 512-777-1861
www.KingsIsle.com
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Erik Pragt
Sent: Tuesday, March 20, 2012 11:55 AM
To: JMeter Users List
Subject: Re: Display total execution time for test plan
Hi Adrian,
Thanks for the super quick reply. I'm a bit surprised by your first
remark though, so maybe I'm having a wrong approach here.
I'm currently developing an application which might have some
performance issues. Our current target is around 1000 simultaneous
logged in users, and around 10 concurrent 'clicks'. My current
approach was to sort of simulate that behavior in JMeter, check how
long it takes for the simulated users to finish their flows, make some
adjustments, test again, and check if my simulated users are faster
than before. Based on this, I need the total execution time, but
apparently this is not the usual approach, else it would certainly
have been in there somewhere.
Could you recommend what would be a better way to test my scenario?
I'm not a performance rock star at all, so I'm very curious what would
be an effective way in improving the application and using JMeter as
the load generator in that.
Kind regards,
Erik Pragt
On Tue, Mar 20, 2012 at 5:44 PM, Adrian Speteanu <[email protected]> wrote:
> Hi Erik,
>
> A very interesting idea.
>
> You can find start / stop time in jmeter's log. When running from a console
> in non-gui mode, you also get some more statistics then in GUI (how long
> the test ran). You can also schedule a test to run for a certain amount of
> time, or starting / stopping at certain hours (so you don't have to worry
> about this stuff).
>
> If you are interested in response times, however, the sum of all requests,
> then things get more complicated.
>
> Adrian
>
> On Tue, Mar 20, 2012 at 6:21 PM, Erik Pragt <[email protected]> wrote:
>
>> Hi all,
>>
>> I've created a test plan to put some load on a flow of pages we have.
>> I'm quite new to JMeter, and I have a small question on how to get the
>> information I'm looking for. I've got a working test plan, I can see
>> the samples, the throughput, etc, but I can't find anywhere what the
>> time was to execute this testplan, or a single loop of this testplan
>> when I execute it multiple times.
>>
>> Can someone give me a small heads up how I can record and view this time?
>>
>> Kind regards,
>>
>> Erik Pragt
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]