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 모든 키가 있어야 합니다.

생성자

Name Description
GaugeAttribute(String[])

GaugeAttribute 클래스의 새 인스턴스를 초기화합니다.

GaugeAttribute(Type)

GaugeAttribute 클래스의 새 인스턴스를 초기화합니다.

속성

Name Description
Name

메트릭의 이름을 가져오거나 설정합니다.

TagNames

메트릭의 태그 이름을 가져옵니다.

Type

메트릭 태그 값을 제공하는 형식을 가져옵니다.

Unit

메트릭의 측정 단위를 가져오거나 설정합니다.

적용 대상