Skip to content

[New feature] Add a new Thread variable named "__jmv_THREAD_START_TIME_ITERATION#6705

Open
vdaburon wants to merge 1 commit into
apache:masterfrom
vdaburon:master
Open

[New feature] Add a new Thread variable named "__jmv_THREAD_START_TIME_ITERATION#6705
vdaburon wants to merge 1 commit into
apache:masterfrom
vdaburon:master

Conversation

@vdaburon
Copy link
Copy Markdown
Contributor

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:

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"
show __jmv_THREAD_START_TIME_ITERATION in debug sampler

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)
show grrovy code to compute delta between curret time and __jmv_THREAD_START_TIME_ITERATION

Types of changes

  • New feature (non-breaking change which adds functionality)

Update documentation: functions.xml
add __jmv_THREAD_START_TIME_ITERATION

…RT_TIME_ITERATION".

It is interesting to know the start timestamp of a thread iteration to calculate cadences or pacing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant