Share via


GaugeAttribute.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 ,方法的傳回型別會當做計量名稱使用。 在這裡範例中,如果未Name提供計量名稱,則MemoryUsage為 。

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

備註

在這裡範例中,計量名稱為 SampleMetric。 未提供 時 Name ,方法的傳回型別會當做計量名稱使用。 在這裡範例中,如果未Name提供,則這會MemoryUsage是 。

適用於