Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calculate http2 async controller parallel processing time #47

Open
serputko opened this issue Apr 24, 2023 · 6 comments
Open

Calculate http2 async controller parallel processing time #47

serputko opened this issue Apr 24, 2023 · 6 comments

Comments

@serputko
Copy link

Can we measure how long http2 async controller took to execute? right now if i add it to transaction controller it add all response times, i'd like to have something similar to what parallel controller provides, just a time from the beginning of execution till last response received

actually using parallel controller with 1 thread as a parent of http2 async controller gives valid timings, so could be used a quick solution
image
At the same time it's not proving both Parent sample time and Child requests times

@serputko
Copy link
Author

@3dgiordano @ck-singh noted one big drawback of using workaround with parallel controller to calculate parent time.
If put http2 async controller inside parallel controller, parallel controller creates separate thread for execution and eventually establish new http2 connection which has huge performance impact in current implementation(if controller has high amount of parallel requests), so i'd suggest not to use parallel controller for now

@ck-singh
Copy link

@serputko, if not parallel controller, is there any other suggested workaround to calculate the correct transaction response time when using http2-async-controller?

@serputko
Copy link
Author

serputko commented May 1, 2023

@ck-singh We can do kind of dirty hack and calculate it by ourselves, might be not too efficient but anyway
Add JSR223 sampler before Async controller and get timestamp before Async controller

vars.putObject("TIMESTAMP_BEFORE", new Date().getTime())
SampleResult.setIgnore()

image
Add JSR223 sampler right after Async controller not including any timers or extra elements. Get current timestamp, calculate duration, create new SampleResult and notify listeners about newly created result. You will get general duration how long it took to execute Async controller and that info will be available in all listeners in your scenario

import org.apache.jmeter.samplers.SampleResult as SR

def timestamp_before = vars.getObject("TIMESTAMP_BEFORE")
def timestamp_after = new Date().getTime()
def duration = timestamp_after - timestamp_before

def thread = ctx.getThread()
def sample_listeners = vars.getObject("JMeterThread.pack").getSampleListeners()
def sample = new SR(timestamp_after, duration)

sample.setSampleLabel("Dummy sampler Async parallel controller processing time")
sample.setSuccessful(true)
thread.notifyListeners(sample_listeners, sample)

SampleResult.setIgnore()

image

Example: 4 separate requests in Async controller taking from 530 to 649ms each, total execution time is 668ms.
668 will include ~5-10ms of JSR223 execution too so keep that in mind
image

@Pill30
Copy link

Pill30 commented Apr 9, 2024

Hi @serputko @ck-singh @3dgiordano
Regarding "Transaction Controller" adding up all the Sampler Response times issue.
Do you know of a permanent fix or solid workaround for this apart from what you have suggested above?
I'm running v2.0.5

Thanks in advance.

@Pill30
Copy link

Pill30 commented Aug 12, 2024

^^^^ Hi @serputko @ck-singh @3dgiordano. Do you have any additional information/help on the above regarding "Transaction Controller" summing up all the Sampler Response times? ^^^^^

Thanks in advance.

@Pill30
Copy link

Pill30 commented Sep 23, 2024

Just wondering if the parallel processing time for the Async controller is in the pipeline to be fixed?

For context, I'm using "Http/2 samplers" inside "Http/2 Async Controller" inside a "Transaction Controller".
Example:

=========================
Transaction Controller
Http/2 Async Controller

  • Http/2 - 200ms Response Time
  • Http/2 - 300ms Response Time
    =========================

Unfortunately, the transaction response time is reported as ~500ms (it's adding them up)
As these are multiplexed/simultaneous, the transaction response time should be reported as ~300ms

As you can imagine, this is impacting how I report Performance results.
Many thanks.

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

No branches or pull requests

3 participants