Share via


HistogramAttribute<T>.Name Proprietà

Definizione

Ottiene o imposta il nome della metrica.

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

Valore della proprietà

Esempio

In questo esempio il nome della metrica è SampleMetric. Se Name non è stato passato, il nome della metrica sarà RequestLatency.

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

Commenti

In questo esempio il nome della metrica è SampleMetric. Quando Name non viene specificato il tipo restituito del metodo viene usato come nome della metrica. In questo esempio, questo sarebbe RequestLatency se Name non fosse stato specificato.

Si applica a