You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jmeter.apache.org by "vdaburon (via GitHub)" <gi...@apache.org> on 2024/09/27 15:41:30 UTC

[PR] Add new thread variable __jmv_THREAD_START_TIME_ITERATION contains the currentTimeMillis when the thread iteration start. [jmeter]

vdaburon opened a new pull request, #6356:
URL: https://github.com/apache/jmeter/pull/6356

   Corresponding to the issue (new feature): https://github.com/apache/jmeter/issues/6319
   
   ## Description
   Add a new unmodifiable JMeter Thread variable named "__jmv_THREAD_START_TIME_ITERATION"
   
   ## Motivation and Context
   
   It is interesting to know the start timestamp of a thread iteration to calculate cadences or pacing.
   
   This variable can also be used to help other Thread Groups calculate cadences (E.g : Concurrency Thread Group or may be Open Model Thread Group)
   
   ## How Has This Been Tested?
   Yes, add a groovy sampler first sampler of the thread group and compute the delta between the value in the variable __jmv_THREAD_START_TIME_ITERATION and the current time System.currentTimeMillis() in the groovy sampler.
   
   Groovy code 
   =========================== 
   long currentTime = System.currentTimeMillis();
   long startThreadIter = Long.parseLong(vars.get("__jmv_THREAD_START_TIME_ITERATION"));
   long delta = currentTime - startThreadIter;
   return delta;
   ===========================
   Results 0 or 1 ms
   ## Screenshots (if appropriate):
   
   ## Types of changes
   - New feature 
   
   ## Checklist:
   - [x ] My code follows the [code style][style-guide] of this project.
   - [ x] I have updated the documentation accordingly.
   Add new variable __jmv_THREAD_START_TIME_ITERATION in the documentation : 
   functions.xml, section 6 Pre-defined Variables
   
   [style-guide]: https://wiki.apache.org/jmeter/CodeStyleGuidelines
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@jmeter.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add new thread variable __jmv_THREAD_START_TIME_ITERATION contains the currentTimeMillis when the thread iteration start. [jmeter]

Posted by "vdaburon (via GitHub)" <gi...@apache.org>.
vdaburon commented on code in PR #6356:
URL: https://github.com/apache/jmeter/pull/6356#discussion_r1779465625


##########
xdocs/usermanual/functions.xml:
##########
@@ -1765,6 +1765,8 @@ However some variables are defined internally by JMeter. These are listed below.
 <li><code>JMeterThread.last_sample_ok</code> - whether or not the last sample was OK - <code>true</code>/<code>false</code>.
 Note: this is updated after PostProcessors and Assertions have been run.
 </li>
+<li><code>__jmv_SAME_USER</code> - is the same user for each iteration ? <code>true</code>/<code>false</code>. Mainly impacts clean cookie, cache data and new connection</li>

Review Comment:
   > _Is this to fix some older code?_
   Yes, when i search this variable "__jmv_SAME_USER" in the documentation, i don't see it. 
   So i add this line about the variable __jmv_SAME_USER.
   And i add the new one variable  "__jmv_THREAD_START_TIME_ITERATION"



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@jmeter.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add new thread variable __jmv_THREAD_START_TIME_ITERATION contains the currentTimeMillis when the thread iteration start. [jmeter]

Posted by "FSchumacher (via GitHub)" <gi...@apache.org>.
FSchumacher commented on code in PR #6356:
URL: https://github.com/apache/jmeter/pull/6356#discussion_r1778863293


##########
xdocs/usermanual/functions.xml:
##########
@@ -1765,6 +1765,8 @@ However some variables are defined internally by JMeter. These are listed below.
 <li><code>JMeterThread.last_sample_ok</code> - whether or not the last sample was OK - <code>true</code>/<code>false</code>.
 Note: this is updated after PostProcessors and Assertions have been run.
 </li>
+<li><code>__jmv_SAME_USER</code> - is the same user for each iteration ? <code>true</code>/<code>false</code>. Mainly impacts clean cookie, cache data and new connection</li>

Review Comment:
   Is this to fix some older code?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@jmeter.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add new thread variable __jmv_THREAD_START_TIME_ITERATION contains the currentTimeMillis when the thread iteration start. [jmeter]

Posted by "vdaburon (via GitHub)" <gi...@apache.org>.
vdaburon closed pull request #6356: Add new thread variable __jmv_THREAD_START_TIME_ITERATION contains the currentTimeMillis when the thread iteration start.
URL: https://github.com/apache/jmeter/pull/6356


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@jmeter.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org