You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by David Luu <ma...@gmail.com> on 2011/11/03 02:03:37 UTC

How best to track start & end times during a test?

Was wondering how best to track/log start & end times for a load test
within JMeter, in case one doesn't adamantly (and manually) note down the
times. Still important even when you have a fixed test duration as you need
to know what times the test ran to correlate logs.

I notice that JMeter's tabular data in the GUI, when saved as CSV via Save
Table Data button does not log any timestamps for start/end of test.
Similarly, unless I misconfigured settings, seems the CSV output of data
(reported in Summary Report or Aggregate Graph) that is set to save to file
when test runs also does not log start/end times, but it does have a
timestamp column, but hard to decipher for me.

Haven't checked the XML output version, but XML is rather verbose, and I
would prefer a condensed CSV of results instead.

And the JMeter graphs, including the JMeter plugins at

http://code.google.com/p/jmeter-plugins/

also don't seem to display start/end times other than test duration span in
minute/seconds on the X-axis.

Feedback appreciated.

Thanks,
David

Re: How best to track start & end times during a test?

Posted by David Luu <ma...@gmail.com>.
Thanks for all the feedback. The debug sampler and JMeter function methods
I can look into. I am using JMeter in GUI mode, so probably can't specify
log file at runtime (don't want to parse the JMeter.log file either).

On Thu, Nov 3, 2011 at 1:54 AM, Nermin CALUK <ne...@atlantbh.com> wrote:

> See if something like this
> ${__javaScript((${__time()}-${TESTSTART.MS})/1000)} works for you
>
> -----Original Message-----
> From: ZK [mailto:stevesenior69@gmail.com]
> Sent: Thursday, November 03, 2011 8:43 AM
> To: jmeter-user@jakarta.apache.org
> Subject: Re: How best to track start & end times during a test?
>
> You could add this to a  'debug sampler' name; inside a 'once only
> controller':
>  [Date=${__time("dd-MM-yyyy",today)}] [Time=${__time("hh:mm",today)}]
>
>
> This would give you the start date and time for your test
>
>
>
>
> ZK
>
> --
> View this message in context:
>
> http://jmeter.512774.n5.nabble.com/How-best-to-track-start-end-times-during-
> a-test-tp4959871p4960358.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>

RE: How best to track start & end times during a test?

Posted by Nermin CALUK <ne...@atlantbh.com>.
See if something like this
${__javaScript((${__time()}-${TESTSTART.MS})/1000)} works for you

-----Original Message-----
From: ZK [mailto:stevesenior69@gmail.com] 
Sent: Thursday, November 03, 2011 8:43 AM
To: jmeter-user@jakarta.apache.org
Subject: Re: How best to track start & end times during a test?

You could add this to a  'debug sampler' name; inside a 'once only
controller':
 [Date=${__time("dd-MM-yyyy",today)}] [Time=${__time("hh:mm",today)}]


This would give you the start date and time for your test




ZK

--
View this message in context:
http://jmeter.512774.n5.nabble.com/How-best-to-track-start-end-times-during-
a-test-tp4959871p4960358.html
Sent from the JMeter - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


RE: How best to track start & end times during a test?

Posted by "Robin D. Wilson" <rw...@gmail.com>.
Thanks to the input, I have devised a way to make this work in a 'Summary Report' listener... It's not pretty, but it is functional.

I've included the contents of my 'TG Timer' here. It uses a separate thread group for the timers, because the 'once only' controller ran once per thread, not once per thread group.

The general idea is setup some variables, poke them into parameters (so I can transfer the values across thread groups) and then read and reset them between each thread group - outputting a dummy sampler line with the timestamp (in ms-since-epoch, but you could change this if you like) and the elapsed time since the last time the 'TG Timer' ran... I intersperse these TG Timers between my sequentially running thread groups and "tah dah!" I get timestamps and elapsed times output in the Summary Report.

------------------------------CUT HERE------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="2.1">
  <hashTree>
    <TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="TG Timer Config" enabled="true">
      <stringProp name="TestPlan.comments">&apos;Disable&apos; the thread groups you aren&apos;t trying to stress.</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">1</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">1</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>
    </hashTree>
  </hashTree>
</jmeterTestPlan>
------------------------------CUT HERE------------------------------
--
Robin D. Wilson


-----Original Message-----
From: Adrian Speteanu [mailto:asp.adieu@gmail.com] 
Sent: Thursday, November 03, 2011 12:45 PM
To: JMeter Users List
Subject: Re: How best to track start & end times during a test?

Hi Robert,

You should take a look at JMeter plugins out there. Some of them give the possibility to switch between relative time (moment 0 - time elapsed) or actual time (time of start - time of last sample).

--
Adrian S

On Thu, Nov 3, 2011 at 5:05 PM, Robin D. Wilson <rw...@gmail.com> wrote:

> I would find it quite useful to see this sort of information on the 
> listeners too in the GUI...
>
> Specifically, I'd like to see execution 'start' and 'end' times, and 
> even thread 'start' and 'end' times. Ideally we'd have the option to 
> see an 'elapsed' time for the test and the threads as well... Some 
> sort of update to the Summary listener would be ideal.
>
> --
> Robin D. Wilson
>
>
> -----Original Message-----
> From: ZK [mailto:stevesenior69@gmail.com]
> Sent: Thursday, November 03, 2011 2:43 AM
> To: jmeter-user@jakarta.apache.org
> Subject: Re: How best to track start & end times during a test?
>
> You could add this to a  'debug sampler' name; inside a 'once only
> controller':
>  [Date=${__time("dd-MM-yyyy",today)}] [Time=${__time("hh:mm",today)}]
>
>
> This would give you the start date and time for your test
>
>
>
>
> ZK
>
> --
> View this message in context:
>
> http://jmeter.512774.n5.nabble.com/How-best-to-track-start-end-times-d
> uring-
> a-test-tp4959871p4960358.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


Re: How best to track start & end times during a test?

Posted by Adrian Speteanu <as...@gmail.com>.
Hi Robert,

You should take a look at JMeter plugins out there. Some of them give the
possibility to switch between relative time (moment 0 - time elapsed) or
actual time (time of start - time of last sample).

--
Adrian S

On Thu, Nov 3, 2011 at 5:05 PM, Robin D. Wilson <rw...@gmail.com> wrote:

> I would find it quite useful to see this sort of information on the
> listeners too in the GUI...
>
> Specifically, I'd like to see execution 'start' and 'end' times, and even
> thread 'start' and 'end' times. Ideally we'd have the option to see an
> 'elapsed' time for the test and the threads as well... Some sort of update
> to the Summary listener would be ideal.
>
> --
> Robin D. Wilson
>
>
> -----Original Message-----
> From: ZK [mailto:stevesenior69@gmail.com]
> Sent: Thursday, November 03, 2011 2:43 AM
> To: jmeter-user@jakarta.apache.org
> Subject: Re: How best to track start & end times during a test?
>
> You could add this to a  'debug sampler' name; inside a 'once only
> controller':
>  [Date=${__time("dd-MM-yyyy",today)}] [Time=${__time("hh:mm",today)}]
>
>
> This would give you the start date and time for your test
>
>
>
>
> ZK
>
> --
> View this message in context:
>
> http://jmeter.512774.n5.nabble.com/How-best-to-track-start-end-times-during-
> a-test-tp4959871p4960358.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>

RE: How best to track start & end times during a test?

Posted by "Robin D. Wilson" <rw...@gmail.com>.
I would find it quite useful to see this sort of information on the
listeners too in the GUI... 

Specifically, I'd like to see execution 'start' and 'end' times, and even
thread 'start' and 'end' times. Ideally we'd have the option to see an
'elapsed' time for the test and the threads as well... Some sort of update
to the Summary listener would be ideal.

--
Robin D. Wilson


-----Original Message-----
From: ZK [mailto:stevesenior69@gmail.com] 
Sent: Thursday, November 03, 2011 2:43 AM
To: jmeter-user@jakarta.apache.org
Subject: Re: How best to track start & end times during a test?

You could add this to a  'debug sampler' name; inside a 'once only
controller':
 [Date=${__time("dd-MM-yyyy",today)}] [Time=${__time("hh:mm",today)}]


This would give you the start date and time for your test




ZK

--
View this message in context:
http://jmeter.512774.n5.nabble.com/How-best-to-track-start-end-times-during-
a-test-tp4959871p4960358.html
Sent from the JMeter - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


Re: How best to track start & end times during a test?

Posted by ZK <st...@gmail.com>.
You could add this to a  'debug sampler' name; inside a 'once only
controller':
 [Date=${__time("dd-MM-yyyy",today)}] [Time=${__time("hh:mm",today)}]


This would give you the start date and time for your test




ZK

--
View this message in context: http://jmeter.512774.n5.nabble.com/How-best-to-track-start-end-times-during-a-test-tp4959871p4960358.html
Sent from the JMeter - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


Re: How best to track start & end times during a test?

Posted by Shmuel Krakower <sh...@gmail.com>.
Hi,
You can set a log file with passing the -j [log_file] parameter to JMeter
on startup.
On the generated log file you can get the start and end time of the run (if
you are running it in non GUI mode and with auto start).

2011/10/27 18:33:33 INFO  - jmeter.engine.StandardJMeterEngine: Running the
test!
2011/10/27 18:34:14 INFO  - jmeter.engine.StandardJMeterEngine: Test has
ended



Good Luck,
Shmuel Krakower.


On Thu, Nov 3, 2011 at 3:03 AM, David Luu <ma...@gmail.com> wrote:

> Was wondering how best to track/log start & end times for a load test
> within JMeter, in case one doesn't adamantly (and manually) note down the
> times. Still important even when you have a fixed test duration as you need
> to know what times the test ran to correlate logs.
>
> I notice that JMeter's tabular data in the GUI, when saved as CSV via Save
> Table Data button does not log any timestamps for start/end of test.
> Similarly, unless I misconfigured settings, seems the CSV output of data
> (reported in Summary Report or Aggregate Graph) that is set to save to file
> when test runs also does not log start/end times, but it does have a
> timestamp column, but hard to decipher for me.
>
> Haven't checked the XML output version, but XML is rather verbose, and I
> would prefer a condensed CSV of results instead.
>
> And the JMeter graphs, including the JMeter plugins at
>
> http://code.google.com/p/jmeter-plugins/
>
> also don't seem to display start/end times other than test duration span in
> minute/seconds on the X-axis.
>
> Feedback appreciated.
>
> Thanks,
> David
>