Reputation: 2113
I'm using jmeter for some load testing. I'm interested in both metrics:
As usual, my request does the following: hit the server, makes some computation, query the database, makes more computation, and then return a response. I'm interested on measuring the time it takes to resolve the query and visualize it on JMeter.
To do this, I'm using the Server Timing Response API, that is, I'm setting a header on my responses to annotate that time. Something like this:
Server-Timing: miss, db;dur=53, app;dur=47.2
For more information, checkout the official documentation. Now, my problem is that I do not if that is even possible with JMeter. I thought that maybe on a JSR223 listener I can do that, but I'm not sure. Any idea how to take those values and represent them in some way?
Upvotes: 0
Views: 251
Reputation: 168157
You can extract it using a suitable Post-Processor like Regular Expression Extractor configured like:
it will extract value 53
from the response and store it into dbdur
JMeter Variable
The next step is declaring this dbdur
as the Sample Variable, it can be done by i.e. adding the next line to user.properties file:
sample_variables=dbdur
More information: Apache JMeter Properties Customization Guide
And finally you can plot the variable value as a custom chart in the HTML Reporting Dashboard like it's described in Generating customs graphs over time chapter, just change example ts-hit
sample variable value to your dbdur
and amend axis/chart titles accordingly.
Upvotes: 1