MetricsServiceExtensions.AddMetrics 方法

定义

重载

AddMetrics(IServiceCollection)

将指标服务添加到指定的 IServiceCollection

AddMetrics(IServiceCollection, Action<IMetricsBuilder>)

将指标服务添加到指定的 IServiceCollection

AddMetrics(IServiceCollection)

Source:
MetricsServiceExtensions.cs
Source:
MetricsServiceExtensions.cs
Source:
MetricsServiceExtensions.cs

将指标服务添加到指定的 IServiceCollection

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddMetrics(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddMetrics (this Microsoft.Extensions.DependencyInjection.IServiceCollection services);
static member AddMetrics : Microsoft.Extensions.DependencyInjection.IServiceCollection -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddMetrics (services As IServiceCollection) As IServiceCollection

参数

services
IServiceCollection

要向其中添加服务的 IServiceCollection

返回

IServiceCollection,以便可以链接其他调用。

适用于

AddMetrics(IServiceCollection, Action<IMetricsBuilder>)

Source:
MetricsServiceExtensions.cs
Source:
MetricsServiceExtensions.cs
Source:
MetricsServiceExtensions.cs

将指标服务添加到指定的 IServiceCollection

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddMetrics(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Action<Microsoft::Extensions::Diagnostics::Metrics::IMetricsBuilder ^> ^ configure);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddMetrics (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Action<Microsoft.Extensions.Diagnostics.Metrics.IMetricsBuilder> configure);
static member AddMetrics : Microsoft.Extensions.DependencyInjection.IServiceCollection * Action<Microsoft.Extensions.Diagnostics.Metrics.IMetricsBuilder> -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddMetrics (services As IServiceCollection, configure As Action(Of IMetricsBuilder)) As IServiceCollection

参数

services
IServiceCollection

要向其中添加服务的 IServiceCollection

configure
Action<IMetricsBuilder>

用于配置 的 IMetricsBuilder回调。

返回

IServiceCollection,以便可以链接其他调用。

适用于