Response time for websockets using Jmeter - jmeter

I am using Jmeter for performance testing of my application. I am testing the websocket component and for that I am using plugins (Peter Doornbosch and Maceij Zaleski)
I am getting proper response back from websocket but I am stuck in finding out the response time of websocket component. I am using the listener 'View result tree' and it gives me back 'Load Time' but the value of this field varies with response timeout.
For ex : If I give response timeout as 1000 ms , the result comes like (1000 + few ms )
If I give response timeout as 500 ms , the result comes like (500 + few ms)
Please let me know if there is any way to find out the accurate response time.
enter image description here
enter image description here
enter image description here

From what I see from the screenshots:
You're using the plugin from Maceij Zaleski
It reads from the stream for the specified amount of time
If you're interested in getting the timings for reading a single message - I would suggest switching to WebSocket Single Read Sampler from Peter Doornbosch
More information:
Single read sample.jmx example test plan
JMeter WebSocket Samplers - A Practical Guide

Related

JMeter - Count requests with responses below defined time

Can you recommend plugin or report for Jmeter 4.0 which count number of requests with responses lower than < define time (eg, 200ms, 500ms, etc.)
I would like get answer on below question:
How many requests per sec can be sent that response time of 90% responses is lower than 200ms
How many responses is below 200ms from Total
% of responses to the response below 200 ms from Total
I'm not aware of any existing plugin which implements your requirement, however you can achieve this using JSR223 Listener
Add JSR223 Listener to your Test Plan
Put the following Groovy code into "Script" area:
if (prev.getTime() < 200) {
prev.setSampleLabel(prev.getSampleLabel() + " < 200")
}
That's it, if your Sampler response time will be below 200 the JSR223 Listener will amend its label and add < 200 postfix to it.
You can view total number of samplers with response time below 200 ms and 90% percentile using "normal" Aggregate Report listener
You can use "Duration Assertion". It will fail all the requests which take more than the expected time and with the "View Result Tree" or "Simple Data writer" listener you can get all the required data and count from the csv/jtl file generated by them.
Hope this help.
Unless you will need absolute numbers, I would recommend the Response Times Percentiles listener (https://jmeter-plugins.org/wiki/RespTimePercentiles/)
This listener will paint a graph of response times and this will clearly show in percentiles below any response time within the range

Response time different in Postman/Jmeter and web API

I have an MVC Web aPI and I have trouble in comparing the response time of this API. I added some code to calculate the response time:
In the AuthorizationFilterAttribute OnAuthorization, I have the below code:
actionContext.Request.Headers.Add("RequestStartTime", DateTime.Now.ToString());
I have an ActionFilterAttribute, and an OnActionExecuted in which I have the below code:
string strRequestStartTime = actionExecutedContext.Request.Headers.GetValues("RequestStartTime").First();
DateTime dtstartTime = DateTime.Parse(strRequestStartTime);
TimeSpan tsTimeTaken = DateTime.Now.Subtract(dtstartTime);
actionExecutedContext.Response.Headers.Add("RequestProcessingTime", tsTimeTaken.TotalMilliseconds + "ms");
The response has the header "RequestProcessingTime" in milli seconds. The issue is whenever I try the same request using Postman/JMeter, I see that the response time is lesser than what I see in my Response. Why is this happening?
I think this is due to the fact the header does not consider time for request to reach the server and response to travel back, my expectation is that it shows only the time, required to process the request on the server side. So JMeter reports time as delta from the time when request has been sent and the time when the last byte has been received, which is more correct in terms of real user experience.
See definitions of "Elapsed Time", "Connect Time" and "Latency" in the JMeter Glossary. You may also be interested in How to Analyze the Results of a Load Test article which demonstrates the impact of network capacity on the overall performance

Timeout of JMS Point-to-point requests in JMeter does not result in an error

We are using Apache JMeter 2.12 in order to measure the response time of our JMS queue. However, we would like to see how many of those requests take less than a certain time. This, according to the official site of JMeter (http://jmeter.apache.org/usermanual/component_reference.html) should be set by the Timeout property. You can see in the photo below how our configuration looks like:
However, setting the timeout does not result in an error after sending 100 requests. We can see that some of them take apparently more than that amount of time:
Is there some other setting I am missing or is there a way to achieve my goal?
Thanks!
The JMeter documentation for JMS Point-to-Point describes the timeout as
The timeout in milliseconds for the reply-messages. If a reply has not been received within the specified time, the specific testcase failes and the specific reply message received after the timeout is discarded. Default value is 2000 ms.
This is timing not the actual sending the message but receipt of a response.
The source for the JMeter Point to Point will determine if you have a 'Receive Queue' Configured. If you do it will go through the executor path and use the timeout value, otherwise it does not use time timeout value.
if (useTemporyQueue()) {
executor = new TemporaryQueueExecutor(session, sendQueue);
} else {
producer = session.createSender(sendQueue);
executor = new FixedQueueExecutor(producer, getTimeoutAsInt(), isUseReqMsgIdAsCorrelId());
}
In your screen shot JNDI name Receive Queue is not defined, thus it uses temporary queue, and does not use the timeout. Should or should not timeout be supported in this case, that is best discussed in JMeter forum.
Alternately if you want to see request times in percentiles/buckets please read this stack overflow Q/A -
I want to find out the percentage of HTTPS requests that take less than a second in JMeter

how to get the response time of web pages in jmeter?

How to generte csv file and load csv using response time graph listener?
Can any one help me in detail that how we find response time in jmeter ?
If you run JMeter in command-line non-GUI mode as follows:
jmeter -n -t /path/to/your/test_plan.jmx -l /path/to/results_file.jtl
your results_file.jtl content will look like:
1409124780902,182,Logon,200,OK,Thread Group 1-1,text,true,214,0
1409124781219,153,Logout,200,OK,Thread Group 1-1,text,true,110,0
where second column is page response time in milliseconds.
Other values are:
"1409124780902" - current time stamp in ms
"182" - page response time
"Logon" - sampler name
"200" - Response Code
"OK" - Response Message
"Thread Group 1-1" - Parent Thread Group name, thread number and iteration.
"text" - response data type
"214" - response data size in bytes
"0" - latency
Once your test run is done you can open JMeter GUI and load this results_file.jtl into the listener of your choice.
You might also be interested in JMeter Plugins Extras Set which is capable of generating nice looking and easy understandable response-time related graphs to wit:
Response Times vs Threads
Response Times Distribution
Response Times Percentiles
You can get it by adding Reporters.
Please keep in mind Reporters is cpu and memory intensive components and thus should not be used while actual load test.
But for sample testing you can use it and for load test run you can get response time, average,throughput etc by saving output to jtl file in JMeter.
For normal/sample run
Aggregate report gives Average response time, min, max, median etc.
Summary report also gives the same with less details,
While performing actual run you can save output of these reporters in a jtl file. After the test results can be analyzed from jtl files.

The way of JMeter Result Analysis

No Of Requests - 2113 ;
Average Response time (s) - 123.5 ;
Response time/Sec (90% of Requests) - 142.9
Minimum Response time (s) - 2.4
Maximum response time (s) - 14.9
Error% -0.0
My Questions - For 2113 requests average response time is 123.5 secs I need to know what will be the response time of average one single request in 2113 requests
The average response time of a single request (1 out of 2,113) will be the value itself, but I'm sure this isn't your question.
Are you simply trying to locate the response time of each request after a given test plan has fully executed, that is, to see each of the 2,113 response times? If so, just add a Summary Report to your thread group. By doing this you'll need to specify an output file (which will get generated if it doesn't already exist) and will show you in detail each of the requests sent to the server, along with the HTTP response code, response time and other goodies.
UPDATE
Per the question posed in the comments via Ripon Al Wasim, the default extension of the results file is CSV, however this is configurable in /bin/jmeter.properties:
# legitimate values: xml, csv, db. Only xml and csv are currently supported.
#jmeter.save.saveservice.output_format=csv
As we can see, JMeter only appears to support XML and CSV.

Resources