MetricsBuilderExtensions.AddListener 方法

定义

重载

AddListener(IMetricsBuilder, IMetricsListener)

注册新 IMetricsListener 实例。

AddListener<T>(IMetricsBuilder)

注册类型的TIMetricsListener

AddListener(IMetricsBuilder, IMetricsListener)

Source:
MetricsBuilderExtensions.Listeners.cs
Source:
MetricsBuilderExtensions.Listeners.cs

注册新 IMetricsListener 实例。

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Diagnostics::Metrics::IMetricsBuilder ^ AddListener(Microsoft::Extensions::Diagnostics::Metrics::IMetricsBuilder ^ builder, Microsoft::Extensions::Diagnostics::Metrics::IMetricsListener ^ listener);
public static Microsoft.Extensions.Diagnostics.Metrics.IMetricsBuilder AddListener (this Microsoft.Extensions.Diagnostics.Metrics.IMetricsBuilder builder, Microsoft.Extensions.Diagnostics.Metrics.IMetricsListener listener);
static member AddListener : Microsoft.Extensions.Diagnostics.Metrics.IMetricsBuilder * Microsoft.Extensions.Diagnostics.Metrics.IMetricsListener -> Microsoft.Extensions.Diagnostics.Metrics.IMetricsBuilder
<Extension()>
Public Function AddListener (builder As IMetricsBuilder, listener As IMetricsListener) As IMetricsBuilder

参数

listener
IMetricsListener

侦听器的实现类型。

返回

返回链接的原始 IMetricsBuilder

适用于

AddListener<T>(IMetricsBuilder)

Source:
MetricsBuilderExtensions.Listeners.cs
Source:
MetricsBuilderExtensions.Listeners.cs

注册类型的TIMetricsListener

public:
generic <typename T>
 where T : class, Microsoft::Extensions::Diagnostics::Metrics::IMetricsListener[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Diagnostics::Metrics::IMetricsBuilder ^ AddListener(Microsoft::Extensions::Diagnostics::Metrics::IMetricsBuilder ^ builder);
public static Microsoft.Extensions.Diagnostics.Metrics.IMetricsBuilder AddListener<T> (this Microsoft.Extensions.Diagnostics.Metrics.IMetricsBuilder builder) where T : class, Microsoft.Extensions.Diagnostics.Metrics.IMetricsListener;
static member AddListener : Microsoft.Extensions.Diagnostics.Metrics.IMetricsBuilder -> Microsoft.Extensions.Diagnostics.Metrics.IMetricsBuilder (requires 'T : null and 'T :> Microsoft.Extensions.Diagnostics.Metrics.IMetricsListener)
<Extension()>
Public Function AddListener(Of T As {Class, IMetricsListener}) (builder As IMetricsBuilder) As IMetricsBuilder

类型参数

T

侦听器的实现类型。

参数

返回

返回链接的原始 IMetricsBuilder

适用于