Transaction duration under load

Hi,

Would it be possible to construct a query that shows how a key transaction performs under load? I have tried but can only come up with a query that plots average duration for all transactions. I would like to be able to pick my key transactions for instance.

This is my query so far, the rate is divided so that the lines end up in the same region.

SELECT rate(count(*), 1 minute)/100000 AS 'Requests per minute',average(duration) FROM Transaction WHERE appName = 'namegoeshere' TIMESERIES SINCE 24 hours ago EXTRAPOLATE UNTIL now

Hi @johan.nordanfors - You are almost there with your NRQL.

Filter by Transaction names for the transactions you want listed:
WHERE name IN()

See transactions broken out:
FACET name

Ensure you are seeing all transactions:
LIMIT MAX

You do not need the UNTIL now as that is the expected UNTIL if it is not supplied. Put it all together and you get:

SELECT rate(count(*), 1 minute)/100000 AS 'Requests per minute',average(duration) FROM Transaction WHERE appName = 'namegoeshere' AND name IN('') TIMESERIES SINCE 24 hours ago FACET name LIMIT MAX EXTRAPOLATE

3 Likes

To add onto the great advice from Stefan New Relic has added some new approaches to querying data and since you asked about Key Transactions you can do like this:

SELECT average(apm.service.transaction.duration) from Metric where appName = 'Foo' facet keyTransactionName TIMESERIES AUTO

This will give you access to specifically the key transactions due to the use of the keyTransactionName attribute. It will then be dynamic so you can change your key transactions and their names and the friendly key transaction names will show.

4 Likes

Thank you @stefan_garnham and @6MM for your great responses, per usual. :slight_smile:

1 Like

Thanks @stefan_garnham and @6MM for providing excellent help, I am learning a lot! I do however feel I need to elaborate on my case. I have been looking at the nice scalability reports provided on the APM tab. While these give a good indication if the system is scaling good in general, I would like to isolate and look at the response time for some individual transactions while they are under load. How can I accomplish this?

1 Like

I guess my question would be what do you feel you are not getting? People have careers completely focusing on what you are asking.

What we have above isolates and focuses on transactions under load.

That is a fair question, my apologies for being unclear. :slight_smile:

So the query so kindly provided by @stefan_garnham :
SELECT rate(count(*), 1 minute)/100000 AS ‘Requests per minute’,average(duration) FROM Transaction WHERE appName = ‘namegoeshere’ AND name IN(‘theTransaction’) TIMESERIES SINCE 24 hours ago FACET name LIMIT MAX EXTRAPOLATE

gives me the rate of transaction per minute and the average duration of ‘theTansaction’. I am thinking, right or wrong, that I would like to see how this particular transaction behaves when the whole system is under stress. So what I think I am missing is a general throughput metric on one curve and the duration on another curve.

I hope I am making sense. It is entirely possible I got this all wrong and there is no real sense in looking at the data this way. :slight_smile:

You might get some value from going through some of the tutorials and documentation.

https://docs.newrelic.com/docs/query-your-data

The transaction event type has many attributes. One of them is duration. NRQL has many functions, but some of them that may help you are average(), min(), max(), percentile() etc.

So something like this works:
Select average(duration) from Transaction where appName = 'foo' facet name since 1 day ago timeseries auto limit max

This is basic new relic stuff. I mean this is the bread and butter stuff, but knowing this is key to using New Relic so I’m guessing you are brand new to it. Read read read the documentation. Like so many complex software solutions there is a lot of detail and using it can be an ‘art’.

The above query says you want the duration plotted on a 1 day chart and you want to see a line for each named transaction on your APM application and you want the intervals for the points on the chart to be decided by the system. You are also telling it not to stop with a handful of names and to list as many as your account settings would support. That might be 2000. So if you have 20 transaction names you will show all 20.

Good luck!

2 Likes

This accomplished what I wanted, to correlate total transactional rate with fluctuation in duration for a single transaction. Maybe there is a more elegant way but this will suffice. I used some simple math just to get the curves in the same ballpark for better visualisation.

SELECT filter(average(duration), WHERE name IN(‘getSearchResultTransactionName’)) AS ‘getSearchResults’, filter(rate(count(*), 1 minute)/30000,WHERE true) as ‘Overall RPM’ FROM Transaction WHERE transactionType = ‘Web’ TIMESERIES 60 minutes SINCE 1 week ago LIMIT MAX

1 Like

Maybe something like this could also illustrate the sort of thing you want?

Select percentage(count(*), where name = ‘getSearchResultTransactionName’) from transaction WHERE transactionType = ‘Web’ TIMESERIES 60 minutes SINCE 1 week ago