You can use the New Relic REST API (v2) to obtain the average throughput for your app, including web application and non-web application throughput. These values appear in the Throughput chart on your app's APM Summary page.
Important
While the examples utilize New Relic's REST API v2, we recommend using NRQL functions for executing metric timeslice queries. Each API value can be mapped to an equivalent NRQL function. To learn how to create NRQL queries based on these API examples, refer to our documentation.
- Go to one.newrelic.com > All capabilities > APM & services > (select an app).
- Click the app's Transaction time chart title, then select your choice.
Web app throughput
To find the average web application throughput value for a time period, use a single command to get the metric HttpDispatcher
:requests_per_minute
. This example shows the time range for a specific 24 hour period.
$curl -X GET "https://api.newrelic.com/v2/applications/${APP_ID}/metrics/data.json" \> -H "X-Api-Key:${API_KEY}" -i \> -d 'names[]=HttpDispatcher&values[]=requests_per_minute&from=2014-02-21T23:59:00+00:00&to=2014-02-22T23:59:00+00:00&summarize=true'
- Be sure to replace
${APPID}
and${APIKEY}
with your application ID and API key for the account. - To change the time range, include
from
andto
values. - To keep the default time period of the last 30 minutes, omit the
from
andto
values. - To return a series of throughput values instead of an average, omit
summarize
.
Web app throughput (single host)
To find the average throughput from a single host, for a given time period, use a single command to get the metric HttpDispatcher
:requests_per_minute
, and specify the numeric ${HOST}
. To identify the host, use the UI or the REST API.
This example shows the time range for a specific 24 hour period.
$curl -X GET "https://api.newrelic.com/v2/applications/${APP_ID}/hosts/${HOST}/metrics/data.json" \> -H "X-Api-Key:${API_KEY}" -i \> -d 'names[]=HttpDispatcher&:values[]=requests_per_minute&from=2014-02-21T23:59:00+00:00&to=2014-02-22T23:59:00+00:00&:summarize=true'
Non-web app throughput
To find the average non-web application throughput value for a given time period, use a single command to get the metric OtherTransaction/all
:requests_per_minute
.
This example shows the time range for a specific 24 hour period.
$curl -X GET "https://api.newrelic.com/v2/applications/${APP_ID}/metrics/data.json" \> -H "X-Api-Key:${API_KEY}" -i \> -d 'names[]=OtherTransaction/all&values[]=requests_per_minute&;from=2014-02-21T23:59:00+00:00&to=2014-02-22T23:59:00+00:00&summarize=true'
- Be sure to replace
${APPID}
and${APIKEY}
with your application ID and API key for the account. - To change the time range (as shown in this example), include
from
andto
values. - To keep the default time period (last 30 minutes), omit the
from
andto
values. - To return a series of throughput values instead of an average, omit
summarize
.
Non-web app throughput (single host)
To obtain the average throughput for a non-web app from a single host, for a given time period, use a single command to obtain the metric OtherTransaction
:requests_per_minute
and specify the numeric ${HOST}
. To identify the host, use the UI or the REST API.
This example shows the time range for a specific 24 hour period.
$curl -X GET "https://api.newrelic.com/v2/applications/${APP_ID}/hosts/${HOST}/metrics/data.json" \> -H "X-Api-Key:${API_KEY}" -i \> -d 'names[]=OtherTransaction/all&:values[]=requests_per_minute&from=2014-02-21T23:59:00+00:00&to=2014-02-22T23:59:00+00:00&:summarize=true'