GaugeAttribute クラス

定義

厳密に型指定されたゲージ メトリック ファクトリ メソッドと関連する型の生成をガイドする情報を提供します。

public ref class GaugeAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Method)]
[System.Diagnostics.Conditional("CODE_GENERATION_ATTRIBUTES")]
public sealed class GaugeAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Method)>]
[<System.Diagnostics.Conditional("CODE_GENERATION_ATTRIBUTES")>]
type GaugeAttribute = class
    inherit Attribute
Public NotInheritable Class GaugeAttribute
Inherits Attribute
継承
GaugeAttribute
属性

static partial class Metric
{
    [Gauge]
    static partial MemoryUsage CreateMemoryUsage(Meter meter);
}

注釈

この属性は、次の制約を持つメソッドに適用されます。

  • 部分メソッドである必要があります。
  • 型として metricName を返す必要があります。 その名前のクラスが生成されます。
  • ジェネリックにすることはできません。
  • 最初のパラメーターとして System.Diagnostics.Metrics.Meter する必要があります。
  • 文字列型パラメーターとして staticTags で提供されるすべてのキーが必要です。

コンストラクター

名前 説明
GaugeAttribute(String[])

GaugeAttribute クラスの新しいインスタンスを初期化します。

GaugeAttribute(Type)

GaugeAttribute クラスの新しいインスタンスを初期化します。

プロパティ

名前 説明
Name

メトリックの名前を取得または設定します。

TagNames

メトリックのタグ名を取得します。

Type

メトリック タグ値を提供する型を取得します。

Unit

メトリックの測定単位を取得または設定します。

適用対象