Getting not the last frame with Websocket Single Reade Sampler.

Issue #88 closed
Former user created an issue

My scenario is: -Create sessioin with Request-Response Sampler (get session id) -Subscride to trading quotes data with Request-Response Sampler using session id -Read data with Single Read Sampler continuously with second delay using Text Frame Filter. Then i get timestamp from the result and compare it with current date to get trading quote delay. Should notice here that quotes data is very frequent, so there are multiple frames per second. The problem is every time i read data the quote delay (current time and quote time difference) increases. But if i re-create a connection every time continuously the problem will be resolved. It means that quotes are good itself So it seems i can't get up to date data using Websocket Single Reade Sampler.

Comments (13)

  1. Peter Doornbosch repo owner

    Did you use the newest (1.2.1) version of the plugin? It fixed an issue with high volume network data.

  2. Peter Doornbosch repo owner

    "It means that quotes are good itself"

    I don't follow this conclusion. There could be an issue in the server that publishing quotes becomes slower and slower as the connection longer exists.

    Did you inspect TCP traffic with WireShark or something similar? That would really reveal whether JMeter can't catch up.

    Also, i wonder what you mean with "second delay". If your problem is that the JMeter doesn't seem to be able to catch up, you should double check that your JMeter testplan does not cause delays. As explained in the documentation, the Read Sampler runs on the JMeter thread-group thread. So, for example, if you have a delay of 2 second in your test sequence and the message is arriving exactly in the middle of that delay, it will seem as if the message was received 1 second later than it was actually received by the network stack....

    Regards Peter

  3. Sergey Kolechkin

    There is delay of 1 second, i see the situation you've described if i re-open a connection every time and it is as expected. But if i use the single connection i have delays up to 15 seconds and greater (the more cycles of reading data the greater delay is). I assume it gives me a frame which was arrived 15 seconds ago. In a browser websocket single connection i don't see delays at all.

  4. Peter Doornbosch repo owner

    Than there must be an issue in your test-plan. Please share it or email it to me so i can have a look.

  5. Sergey Kolechkin

    Here it is. I've changed a quote symbol to test one because it is not trading time now, so there won't be quotes for common symbols. This symbol has 4-5 quotes per 5 seconds so i've also increased delay up to 5 seconds. I expect to get maximum delay of about 5 seconds. But it is increased every time i read a quote. You can see this in Log window or in the Connect Times listner (writing delay into connection time of the Read quote sampler to be able to output it into graph)

  6. Sergey Kolechkin

    Seems it is an issue of combination Single Read Sampler with Timers. Disabled timer in the plan and got real delays

  7. Peter Doornbosch repo owner

    Indeed, that's problem. The timer pauses the test, and thus also delays the read. Instead of introducing a timer, you should enlarge the read timeout in the read sampler.

  8. Sergey Kolechkin

    I think this won't work in my case. I don't need every single frame but the last one in a second. Also tried to replace timer with dummy sampler with generated response time before the Single Read Sampler. Got the same result - growing delay. So it seems we can't use this plugin in a common thread including regular HTTP requests as stated cause we'll get pauses of websocket connection during HTTP requests response times and we need to maintain a special thread for websocket connection.

  9. Peter Doornbosch repo owner

    If you need only the last frame, still you could read all of them and only use the last. But if you need to perform HTTP request in between (is it necessary these are done from the same JMeter thread?), and the websockets frames are coming while the HTTP sampler is sending/receiving, then indeed you'll get incorrect timings for the ws frames.

  10. Log in to comment