cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

API, Database Statement Response Time by Request Count

TylerProduct
Newcomer

Hello, I'm trying to hit an API that will return the response time of my top X database statements by response time. Im using the accept:text/csv header, and would like to see the response time and request count returned in separate columns for each X database statement for a given a period of time.

3 REPLIES 3

Hi, you can combine boths calls in a single API call but it won't output a single array with two dimensions. You have to process them afterwards.

 

see example:

 

/api/v2/metrics/query?metricSelector=(builtin:service.response.time:splitBy():sort(value(auto,descending)):limit(100)):limit(100):names,(builtin:service.requestCount.total:splitBy():sort(value(auto,descending)):limit(100)):limit(100):names&from=-2h&to=now&api-token=XXXXXXXXXXXXX

Thank you for your reply, this is very helpful. How do I add the database statements do the call so I can map them to the values?

Database statements metrics are not available out of the box for each statement. It's the same as for webservice request/operation at webservice level.
Statements must be marked as key requests before (see below)
dbkr.jpg

 

Then the related metrics that you can use are

builtin:service.keyRequest.count.total for request count

builtin:service.keyRequest.response.time for response time

you can filter by key request identifier which is "SERVICE_METHOD-XXXXXXX" you can find in the url of the screenshot above.

Featured Posts