Syntax
NewRelic.Api.Agent.NewRelic.RecordResponseTimeMetric(string $metric_name, Int64 $metric_value)
Records a custom metric with the given name and response time in milliseconds.
Requirements
Compatible with all agent versions.
Compatible with all app types.
Description
Records the response time in milliseconds for a custom metric. To view these custom metrics, use the query builder to search metrics and create customizable charts. See also IncrementCounter()
and RecordMetric()
.
重要
When creating a custom metric, start the name with Custom/
(for example, Custom/MyMetric
).
Parameters
Parameter | Description |
---|---|
string | Required. The name of the response time metric to record. Only the first 255 characters are retained. |
Int64 | Required. The response time to record in milliseconds. |
Examples
Record response time of a sleeping process
Stopwatch stopWatch = Stopwatch.StartNew();System.Threading.Thread.Sleep(5000);stopWatch.Stop();NewRelic.Api.Agent.NewRelic.RecordResponseTimeMetric("Custom/DEMO_Record_Response_Time_Metric", stopWatch.ElapsedMilliseconds);
その他のヘルプ
さらに支援が必要な場合は、これらのサポートと学習リソースを確認してください:
- Explorers Hubでは、コミュニティからのサポートを受けたり、ディスカッションに参加したりすることができます。
- 当社サイトで答えを見つけて、サポートポータルの使用方法を確認してください。
- Linux、Windows、およびmacOS向けトラブルシューティングツールであるNew Relic Diagnosticsを実行してください。
- New Relicの とandドキュメント をご確認ください。