0
votes

I'm hoping someone has some experience with asynchronous testing and how to accomplish it with Jmeter. If someone does know, but not with jmeter, also open to other options, but more familiar with jmeter and the context is for load/stress testing.

Definition: For example, sending raw TCP textual datastreams where the "session" id is within the datastream itself. Everything is asynchronous and could be 'out-of-order' as far as returns.

Example: So, given a sample of 10 datastreams with an end signal of \n over 5 threads, it is possible for all 10 to be sent over the same TCP port before the first one responds, and the response could be in any order.

session00001datasenthere\n

session00002datalsosenthere\n

session00003differentdata\n

...

session00010moredifferentdata\n

Using Jmeter, I do want to measure how long it takes for each given datastream based on the sessionid (say data bytes 8-12 of the streams in this example) to return. The intent is to use Jmeter for what it is good at, load/stress testing across multiple machines, but smart enough to understand the asynch TCP data (opposed to your normal HTTP session request/response).

Constraint is during any given testing session the 'sessionid' is unique at least until a response stream is returned (for logistic reasons, otherwise couldn't pull this off ;-).

Thanks in advance, and just to ensure intent is understood, this is to take advantage of all the nice ready-to-go reports/listeners/plugins/analytics available to Jmeter.

EDIT: The implementation of the server under test is Netty, not dissimilar to the Telnet example. If there is a Jmeter example of testing the Netty example Telnet server that may also help.

-D

1
could you show a full example Saying thread1 sends this, thread 2 this..., response for threadxxx... ? Not clear what you want to doUBIK LOAD PACK
What is you challenge exactly? Is it related to setting unique session id in each request?PålOliver
Jmeter does not know when a response comes back that it is tied to which request. Setting a 'sessionid' on the request sent out is easy but is dependent on the TCP payload, how do you setup your tcp sampler test, or maybe custom java client sampler, to handle whatever the sessionId is for the TCP payload? EXAMPLE: session 00003 was sent with a bunch of other payloads, how can you tell Jmeter that when session00003 comes pack to compare the time request to the time response to measure the actual response time of session00003 rather than just the first response in an asynchronous environment?dhartford

1 Answers

1
votes

Your option I think is to implement a Java Request Sampler.

You could define the following parameters for your Java Request Sampler implementation:

  • server host
  • server port
  • connection identifier(see later)
  • session identifier
  • data

Read carefully the documentation of JavaSamplerClient to understand the lifecycle. Each thread will have one instance of your sampler.

Then in your implementation you need to take care of the following things:

  • create a connection handler class, which opens up sockets for each connection identifier. Test cases using the same connection identifier will send data through the same socket. This connection handler should take care of sending the data synchronized way and to give back the response to the appropiate instance, which is waiting for it
  • in your sampler you have to create exactly one connection handler (or one per server, or one per port, as you wish)
  • when the sampler sends some text, you give it to the connection handler, and the sampler waits till the response comes.

This way you can simply convert your asynchronous problem to a synchronous one with implementing this conenction handler, which is shared between the sampler instances. But take care of the implementation to be sure that your thread programming does not fake the results with some testing tool side bottleneck.