jmeter-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vladimir Sitnikov <sitnikov.vladi...@gmail.com>
Subject Re: Avoid thread sleep on delays
Date Fri, 18 Oct 2019 19:32:50 GMT
>Maybe it’s time to have a more user friendly thread group in JMeter core.

Maybe. Frankly speaking, I want to add variable throughput to Precise Timer.
Whatever "ultimate thread group" is doing now could be re-written in Kotlin
with 1-2-3 days and that is it.

Of course, we might want to implement improved workload configuration in
core, however, we can implement that later.

>What about Thread Group plugins (ultimate ...)?

The other thread groups could **easily** be re-written in Kotlin.
https://github.com/apache/jmeter/blob/3b06ef691eaff18fd62916b1cf2211ba7b7f4dd1/src/core/src/main/kotlin/org/apache/jmeter/threads/MultitaskThreadGroup.kt#L26

^^^ this is 30 lines that launch "threads"

The **pluggable** support for async in samplers is trivial as below:

Current interface:

public interface Sampler ... {
    SampleResult sample(Entry e);
}

We can add Kotlin interface (it can be implemented in both Java and Kotlin):

public interface SuspendableSampler ... {
    suspend fun sample(e: Entry): SampleResult
}

Then samplers might implement it, then the core would invoke suspendable
interface if it sees that the sampler implements one.

On top of that, we can add the following method to the Java interface:
   CompletableFuture<SampleResult> sampleAsync(Entry e);

It is very easy to support that in coroutines (the coroutine would be
resumed when the future completes)

Vladimir

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message