• EnglishEspañol日本語한국어Português
  • ログイン今すぐ開始

この機械翻訳は、参考として提供されています。

In the event of any inconsistency between the English version and the translated version, the English versionwill take priority. Please visit this page for more information.

問題を作成する

RecordResponseTimeMetric(.NETエージェントAPI)

構文

NewRelic.Api.Agent.NewRelic.RecordResponseTimeMetric(string $metric_name, Int64 $metric_value)

指定された名前と応答時間(ミリ秒)でカスタムメトリックを記録します。

要件

すべてのAgentバージョンに対応しています。

すべてのアプリタイプに対応しています。

説明

カスタム指標の応答時間をミリ秒単位で記録します。これらのカスタム メトリックを表示するには、 クエリ ビルダーを使用してメトリックを検索し、カスタマイズ可能なグラフを作成します。IncrementCounter()RecordMetric()も参照してください。

重要

カスタム指標を作成するときは、名前をCustom/で始めます (例: Custom/MyMetric )。

パラメーター

パラメータ

説明

$metric_name

ストリング

必須です。記録する応答時間メトリックの名前です。最初の255文字のみが保持されます。

$metric_value

Int64

必須です。記録する応答時間をミリ秒単位で指定します。

スリープ中のプロセスの応答時間を記録

Stopwatch stopWatch = Stopwatch.StartNew();
System.Threading.Thread.Sleep(5000);
stopWatch.Stop();
NewRelic.Api.Agent.NewRelic.RecordResponseTimeMetric("Custom/DEMO_Record_Response_Time_Metric", stopWatch.ElapsedMilliseconds);
Copyright © 2024 New Relic株式会社。

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.