Share via


HistogramAttribute<T>.Name 속성

정의

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

public:
 property System::String ^ Name { System::String ^ get(); void set(System::String ^ value); };
public string? Name { get; set; }
member this.Name : string with get, set
Public Property Name As String

속성 값

예제

이 예제에서 메트릭 이름은 입니다 SampleMetric. 전달되지 않은 경우 Name 메트릭 이름은 입니다 RequestLatency.

static partial class Metric
{
    [Histogram<int>("RequestName", "RequestStatusCode", Name = "SampleMetric")]
    static partial RequestLatency CreateRequestLatency(Meter meter);
}

설명

이 예제에서 메트릭 이름은 입니다 SampleMetric. 가 Name 제공되지 않으면 메서드의 반환 형식이 메트릭 이름으로 사용됩니다. 이 예제에서는 제공되지 않은 경우 Name 입니다RequestLatency.

적용 대상