Blazemeter / jmeter-http2-plugin

HTTP2 plugin for Apache JMeter
Apache License 2.0
46 stars 27 forks source link

Calculate http2 async controller parallel processing time #47

Open serputko opened 1 year ago

serputko commented 1 year ago

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 commented 1 year ago

@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 commented 1 year ago

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

serputko commented 1 year ago

@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 commented 7 months ago

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 commented 3 months ago

^^^^ 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 commented 2 months ago

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

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.