Here is an example of how to use the New Relic API Explorer (v2) to get your application's average response time over a specified time period.
Contents
Average response time
The average response time (milliseconds) is the value that appears on the main chart for your app on the APM Summary page. New Relic uses this formula to calculate response time:
Response time = HttpDispatcher:average_call_time + ((WebFrontend/Queue:call_count * WebFrontend/Queue:average_response_time)/ HttpDispatcher:call_count)
To obtain the metric values, use the following two commands.
In these examples, the same time period has been used for each, and they are both summarized (averaged).
curl -X GET "https://api.newrelic.com/v2/applications/${APPID}/metrics/data.xml" \
-H "X-Api-Key:${APIKEY}" -i \
-d 'names[]=HttpDispatcher&values[]=average_call_time&values[]=call_count&from=2014-03-01T20:59:00+00:00&to=2014-03-01T21:59:00+00:00&summarize=true'
curl -X GET "https://api.newrelic.com/v2/applications/${APPID}/metrics/data.xml" \
-H "X-Api-Key:${APIKEY}" -i \
-d 'names[]=WebFrontend/QueueTime&values[]=call_count&values[]=average_response_time&from=2014-03-01T20:59:00+00:00&to=2014-03-01T21:59:00+00:00&summarize=true'
Your application may have zero queuing time for the time period in question. In that case, the WebFrontend/QueueTime
metric will have a zero value.
ヒント
If your app has never reported a queuing time, the metric WebFrontend/QueueTime
will not exist.
Response time
On the APM Summary page, Response time is the overlaid line within the main chart for your app. To obtain the metric values shown by this line, use the same formula and two commands described above, but remove summarize=true
from the commands.
その他のヘルプ
さらに支援が必要な場合は、これらのサポートと学習リソースを確認してください:
- Explorers Hubでは、コミュニティからのサポートを受けたり、ディスカッションに参加したりすることができます。
- 当社サイトで答えを見つけて、サポートポータルの使用方法を確認してください。
- Linux、Windows、およびmacOS向けトラブルシューティングツールであるNew Relic Diagnosticsを実行してください。
- New Relicの とandドキュメント をご確認ください。