MetricsBuilderExtensions.EnableMetrics 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
EnableMetrics(IMetricsBuilder, String)
为所有已注册的 IMetricsListeners 启用给定计量器的所有 Instruments。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::Diagnostics::Metrics::IMetricsBuilder ^ EnableMetrics(Microsoft::Extensions::Diagnostics::Metrics::IMetricsBuilder ^ builder, System::String ^ meterName);
public static Microsoft.Extensions.Diagnostics.Metrics.IMetricsBuilder EnableMetrics (this Microsoft.Extensions.Diagnostics.Metrics.IMetricsBuilder builder, string? meterName);
static member EnableMetrics : Microsoft.Extensions.Diagnostics.Metrics.IMetricsBuilder * string -> Microsoft.Extensions.Diagnostics.Metrics.IMetricsBuilder
<Extension()>
Public Function EnableMetrics (builder As IMetricsBuilder, meterName As String) As IMetricsBuilder
参数
- builder
- IMetricsBuilder
返回
用于链接的原始 IMetricsBuilder 值。
适用于
EnableMetrics(MetricsOptions, String)
为所有已注册的 IMetricsListeners 启用给定计量器的所有 Instruments。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::Diagnostics::Metrics::MetricsOptions ^ EnableMetrics(Microsoft::Extensions::Diagnostics::Metrics::MetricsOptions ^ options, System::String ^ meterName);
public static Microsoft.Extensions.Diagnostics.Metrics.MetricsOptions EnableMetrics (this Microsoft.Extensions.Diagnostics.Metrics.MetricsOptions options, string? meterName);
static member EnableMetrics : Microsoft.Extensions.Diagnostics.Metrics.MetricsOptions * string -> Microsoft.Extensions.Diagnostics.Metrics.MetricsOptions
<Extension()>
Public Function EnableMetrics (options As MetricsOptions, meterName As String) As MetricsOptions
参数
- options
- MetricsOptions
返回
用于链接的原始 MetricsOptions 值。
适用于
EnableMetrics(IMetricsBuilder, String, String, String, MeterScope)
为给定 Meter 和 IMetricsListener启用指定的 Instrument 。
public static Microsoft.Extensions.Diagnostics.Metrics.IMetricsBuilder EnableMetrics (this Microsoft.Extensions.Diagnostics.Metrics.IMetricsBuilder builder, string? meterName, string? instrumentName = default, string? listenerName = default, Microsoft.Extensions.Diagnostics.Metrics.MeterScope scopes = Microsoft.Extensions.Diagnostics.Metrics.MeterScope.Global | Microsoft.Extensions.Diagnostics.Metrics.MeterScope.Local);
static member EnableMetrics : Microsoft.Extensions.Diagnostics.Metrics.IMetricsBuilder * string * string * string * Microsoft.Extensions.Diagnostics.Metrics.MeterScope -> Microsoft.Extensions.Diagnostics.Metrics.IMetricsBuilder
<Extension()>
Public Function EnableMetrics (builder As IMetricsBuilder, meterName As String, Optional instrumentName As String = Nothing, Optional listenerName As String = Nothing, Optional scopes As MeterScope = Microsoft.Extensions.Diagnostics.Metrics.MeterScope.Global | Microsoft.Extensions.Diagnostics.Metrics.MeterScope.Local) As IMetricsBuilder
参数
- builder
- IMetricsBuilder
- listenerName
- String
。 IMetricsListener名字。 null 值匹配所有侦听器。
- scopes
- MeterScope
指示要考虑的 MeterScope。 默认为所有范围。
返回
用于链接的原始 IMetricsBuilder 值。
适用于
EnableMetrics(MetricsOptions, String, String, String, MeterScope)
为给定 Meter 和 IMetricsListener启用指定的 Instrument 。
public static Microsoft.Extensions.Diagnostics.Metrics.MetricsOptions EnableMetrics (this Microsoft.Extensions.Diagnostics.Metrics.MetricsOptions options, string? meterName, string? instrumentName = default, string? listenerName = default, Microsoft.Extensions.Diagnostics.Metrics.MeterScope scopes = Microsoft.Extensions.Diagnostics.Metrics.MeterScope.Global | Microsoft.Extensions.Diagnostics.Metrics.MeterScope.Local);
static member EnableMetrics : Microsoft.Extensions.Diagnostics.Metrics.MetricsOptions * string * string * string * Microsoft.Extensions.Diagnostics.Metrics.MeterScope -> Microsoft.Extensions.Diagnostics.Metrics.MetricsOptions
<Extension()>
Public Function EnableMetrics (options As MetricsOptions, meterName As String, Optional instrumentName As String = Nothing, Optional listenerName As String = Nothing, Optional scopes As MeterScope = Microsoft.Extensions.Diagnostics.Metrics.MeterScope.Global | Microsoft.Extensions.Diagnostics.Metrics.MeterScope.Local) As MetricsOptions
参数
- options
- MetricsOptions
- listenerName
- String
。 IMetricsListener名字。 null 值匹配所有侦听器。
- scopes
- MeterScope
指示要考虑的 MeterScope。 默认为所有范围。
返回
用于链接的原始 MeterOptions 值。