Your data. Anywhere you go.

New Relic for iOS or Android


Download on the App Store    Android App on Google play


New Relic Insights App for iOS


Download on the App Store


Learn more

Close icon

Using NRQL - Trying to find the max count of certain transactions in an hour from last week, month, year

nrql

#1

I am somewhat familiar with NRQL and have created dashboard to count the total requests count of certain transactions in a month/year.

SELECT count(*)/1000 AS ‘Thousands Requests’ FROM Transaction WHERE appName IN (‘my-app-name’) and name like ‘%my-transaction-name%’ SINCE 1 month ago

Now i am trying to find out the max count of the same transaction per hour over a period of one week, one month or a year. Like was this call made 20 times in an hour or 200 times in an hour.

I am not looking for transaction duration.


#2

Hi, @Yash.Chhoker: NRQL does not generally support nested functions, so unfortunately you cannot do max(count(*)) . One workaround is to execute the count() query on a schedule (say, every 30 minutes) and insert the result as a custom event. Then you can get the max() of that count value in a separate query.

If this is not something you need to do frequently, another option is to export the result of the count() query to a spreadsheet, and use it to find the maximum value.


#3

Thank you Phil. I need to do it occasionally may be once a month or few times a year.
I will look at exporting the results article you mentioned.