I am trying to handle a SSE request which gives response in the form of event stream, but Jmeter is giving error
org.apache.http.ConnectionClosedException: Premature end of chunk coded message body: closing chunk expected
Is there any element to handle such request?
As of latest JMeter version (JMeter 5.1) there is no SSE support, you should probably consider switching to Gatling tool which has SSE support.
If you would like to stay with JMeter you can still test SSE, however you will have to use JSR223 Test Elements and handle the SSEs using Groovy scripting. Check out How to Load Test SSE Services with JMeter article for more details if interested.
Related
I have to generate load for my performance testing using JMeter. I am having .Net code to send data to IOT hub which we want to use.
I can easily create REST endpoints or executable based on requirement. To integrate with JMeter which Sampler I should prefer OS Sampler or HTTP request Sampler to integrate with existing .Net code.
We will be use distributed testing in JMeter so if we go with REST Endpoints then scaling will be required but scaling is not required in case of executable so I think OS Sampler is better over HTTP request Sampler.
Do you see any concern using OS Sampler over HTTP request Sampler?
Please suggest performance comparison also.
Thanks in advance.
If you have a .NET executable which performs an IOT broker load testing - you don't need JMeter.
If you choosing the way to proceed I would recommend going for HTTP Request samplers as with the OS Process sampler you will have only .NET application execution time while with the HTTP Request samplers you will see:
connect time
latency also known as time to first byte
"pure" response time for each and every HTTP request
ability to correlate increasing load with changing other metrics like throughput, server hits per second, response time, etc. using HTML Reporting Dashboard
I am testing rest service which has subscription end point with header(2 key value pairs) values. On sucessful subscription I get 200 ok and soon get data streaming. How can I load test this in Jmeter?
As of current JMeter version 5.2.1 there is no built-in SSE support.
The options are in:
Consider another load testing tool which supports SSE like Gatling
Add SSE support to JMeter by adding a library which supports server sent events like okhttp-eventsource to JMeter Classpath and implement your test scenario using JSR223 Sampler(s) and Groovy language. Check out How to Load Test SSE Services with JMeter article for more information if you decide to stay with JMeter
I am pretty new to load testing and whole web thing.
Is there any way to implement things that this Vugen Loadrunner code do
web_custom_request("action",
"{URL}",
"Method=POST",
"Resource=0",
"RecContentType=text/html",
"Referer={refURL}",
"Snapshot=t57.inf",
"Mode=HTTP",
"Body={PARAMETER}",
LAST);
In jmeter? The {PARAMETER} is just a String.
JMeter's equivalent would be HTTP Request sampler.
JMeter's Variables have a little bit different syntax so the equivalent configuration would be something like:
If you want to have full control there is also HTTP Raw Request sampler which can be installed using JMeter Plugins Manager
Also be aware that you can record your LoadRunner script using JMeter's HTTP(S) Test Script Recorder, just start JMeter's HTTP(S) Test Script Recorder and in LoadRunner's Runtime Settings set JMeter as the proxy:
When you run your LoadRunner test JMeter will capture the requests and save them under Recording Controller
More information: How to Convert LoadRunner Tests to JMeter
To send any kind of HTTP Request you can use HTTP Request Sampler
To start with use this practical example : build-web-test-plan and then move to advanced build-adv-web-test-plan
Parameterization in JMeter and
Correlation in JMeter
Being a performance tester/engineer/architect brings with it a core ability to recognize patterns associated with success and failure
I am pretty new to load testing and whole web thing.
This is a massive antipattern for success in this field. You need your foundation skills vetted and shored up. You really do need training and a mentor for a period of time.
If your management is asking you to perform in this role, then they should also ensure your path to success. If they are unwilling to fund your training and mentoring period, then I would recommend seeking new management who are more interested in your success and the success of the project.
I am looking for a way to performance and stress test my SPA.
I prefer an open source(free) tool to do so.
I have searched quite a lot(https://www.blazemeter.com/blog/how-load-test-ajaxxhr-enabled-sites-jmeter) about the possibility to use Jmeter but i am still not sure if it is possible as this is an SPA and Jmeter works on the protocol level.
JMeter is not a browser as such it will not:
play URLs called through javascript.
report time taken in UI by javascript to display it
But the good news is that you can record all requests at HTTP protocol level,
all requests will be nested inside a Transaction Controller.
JMeter will play them sequentially and not in parallel.
So:
response time will be sum of Main + child requests response time
Load simulation will not be highly impacted as parallelism due to load testing will be simulated
There is also JMeter Webdriver Sampler that allows you to use a Real Browser
So by combining both approach you should be able to:
- Simulate load on your target application
- Have an idea of User Experience response times through JMeter Webdriver Sampler
You can install both plugins using JMeter-Plugins plugin manager plugin.
Note there is a 3rd party plugin that provides parallel execution if you want the parallel execution but I'm not sure it's needed:
https://github.com/Blazemeter/jmeter-bzm-plugins/blob/master/parallel/Parallel.md
The mobile app that I am testing with Jmeter makes 4 asynchronous API calls when logging in. Is there any way to simulate this with JMeter ?
Currently I can only get JMeter to make the calls synchronously, so when wrapping them all in the same transaction controller, the response time is the total of the 4 calls (instead of the highest one)
Many thanks
Currently JMeter doesn't offer a relevant test element, the easiest way of implementing your scenario is using JSR223 Sampler to perform nested asynchronous calls, something like:
See How to Load Test AJAX/XHR Enabled Sites With JMeter guide for more detailed explanation, code snippets,etc.
You can also consider developing a custom sampler with similar functionality and make it a part of your JMeter as a plugin or even share it with the community.
Take a look at Parallel Controller in JMeter.
All elements inside the Parallel Controller will be executed parallel to each other. This way, you will have one main flow and other flows with asynchronous requests, which will be executed in a parallel way.
https://www.blazemeter.com/blog/how-to-load-test-async-requests-with-jmeter