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

Average monthly response times

restapi
api

#1

Hello,

I am interested in querying the average monthly response times from EndUser and HttpDispatcher. I saw in the documentation that the period= param can control a time period output, but the param is only in seconds. Is there any param that I could use to ask for monthly time periods? Currently, I am making separate queries with to= and from= set as the beginning and endings of each month with summarize=true.


#2

Hi, @chelseyl: If you have at least 30 days of data retention, Insights is the easiest way to do this:

SELECT average(duration) FROM Transaction WHERE appName = 'My Application' SINCE 1 month ago
SELECT average(duration) FROM PageView WHERE appName = 'My Application' SINCE 1 month ago

Using the REST API, you may specify from and to date parameters:

curl -X GET 'https://api.newrelic.com/v2/applications/{application_id}/metrics/data.json' \
     -H 'X-Api-Key: YOUR_API_KEY' -i \
     -G -d 'names[]=EndUser&values[]=average_response_time&from=2018-09-17T00:01:00+00:00&to=2018-10-16T23:59:00+00:00&summarize=true' 

You may find the API Explorer helpful in formulating the correct API calls.


#3

Another example, depending on your data retention policy, would be:

SELECT average(duration) FROM PageView WHERE appName = 'My Application' SINCE 12 months ago FACET monthOf(timestamp)


#4

Hey @chelseyl - was Phil & Stefan’s comments helpful? Let us know if you found the information you’re looking for through Insights :smiley: