vdaburon opened a new pull request, #6705:
URL: https://github.com/apache/jmeter/pull/6705
## 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**.
## 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:
```groovy
long currentTime = System.currentTimeMillis();
long startThreadIter =
Long.parseLong(vars.get("__jmv_THREAD_START_TIME_ITERATION"));
long delta = currentTime - startThreadIter;
return delta;
```
Results delta = 0 or 1 ms
## Screenshots (if appropriate):
Show the new thread variable in the "Debug Sampler"
<img width="827" height="562" alt="show __jmv_THREAD_START_TIME_ITERATION in
debug sampler"
src="https://github.com/user-attachments/assets/7ae64df9-4866-43df-af4e-3443e5192435"
/>
Show the Groovy code in the View Results Tree, delta is usually 0 or 1 ms
(except for the first call which is a little longer)
<img width="1151" height="570" alt="show grrovy code to compute delta
between curret time and __jmv_THREAD_START_TIME_ITERATION"
src="https://github.com/user-attachments/assets/d52eac64-ef50-4faa-b2f4-08083128fc5e"
/>
## Types of changes
- New feature (non-breaking change which adds functionality)
Update documentation: functions.xml
add __jmv_THREAD_START_TIME_ITERATION
[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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]