Class ServerTimingOptionsExtensions
The ServerTimingOptions extensions for registering IServerTimingMetricFilter<TContext>s.
Inheritance
Inherited Members
Namespace: Lib.AspNetCore.ServerTiming
Assembly: Lib.AspNetCore.ServerTiming.dll
Syntax
public static class ServerTimingOptionsExtensions
Methods
AddCustomMetricFilter(ServerTimingOptions, Func<HttpContext, ICollection<ServerTimingMetric>, Boolean>)
Adds a custom IServerTimingMetricFilter<TContext>.
Declaration
public static void AddCustomMetricFilter(this ServerTimingOptions options, Func<HttpContext, ICollection<ServerTimingMetric>, bool> filter)
Parameters
Type | Name | Description |
---|---|---|
ServerTimingOptions | options | The ServerTimingOptions to modify. |
System.Func<Microsoft.AspNetCore.Http.HttpContext, System.Collections.Generic.ICollection<ServerTimingMetric>, System.Boolean> | filter | The function used for inspecting and modifying the collection of metrics. |
RestrictDescriptionsToDevelopment(ServerTimingOptions, IHostEnvironment)
Adds IServerTimingMetricFilter<TContext> which will remove the descriptions from all metrics unless an application is running in development environment.
Declaration
public static void RestrictDescriptionsToDevelopment(this ServerTimingOptions options, IHostEnvironment hostEnvironment)
Parameters
Type | Name | Description |
---|---|---|
ServerTimingOptions | options | The ServerTimingOptions to modify. |
Microsoft.Extensions.Hosting.IHostEnvironment | hostEnvironment | The Microsoft.Extensions.Hosting.IHostEnvironment used to determine the hosting environment an application is running in. |
RestrictMetricsToDevelopment(ServerTimingOptions, IHostEnvironment)
Adds IServerTimingMetricFilter<TContext> which will remove all metrics unless an application is running in development environment.
Declaration
public static void RestrictMetricsToDevelopment(this ServerTimingOptions options, IHostEnvironment hostEnvironment)
Parameters
Type | Name | Description |
---|---|---|
ServerTimingOptions | options | The ServerTimingOptions to modify. |
Microsoft.Extensions.Hosting.IHostEnvironment | hostEnvironment | The Microsoft.Extensions.Hosting.IHostEnvironment used to determine the hosting environment an application is running in. |
RestrictMetricsToIp(ServerTimingOptions, IPAddress)
Adds IServerTimingMetricFilter<TContext> which will remove all metrics unless request comes from specific IP address.
Declaration
public static void RestrictMetricsToIp(this ServerTimingOptions options, IPAddress address)
Parameters
Type | Name | Description |
---|---|---|
ServerTimingOptions | options | The ServerTimingOptions to modify. |
System.Net.IPAddress | address | The IP Address which is allowed to receive the metrics. |
RestrictMetricsToIp(ServerTimingOptions, String)
Adds IServerTimingMetricFilter<TContext> which will remove all metrics unless request comes from specific IP address.
Declaration
public static void RestrictMetricsToIp(this ServerTimingOptions options, string address)
Parameters
Type | Name | Description |
---|---|---|
ServerTimingOptions | options | The ServerTimingOptions to modify. |
System.String | address | The IP Address which is allowed to receive the metrics. |
RestrictMetricsToIpRange(ServerTimingOptions, IPAddress, IPAddress)
Adds IServerTimingMetricFilter<TContext> which will remove all metrics unless request comes from IP address which falls within the specified range.
Declaration
public static void RestrictMetricsToIpRange(this ServerTimingOptions options, IPAddress lowerInclusive, IPAddress upperInclusive)
Parameters
Type | Name | Description |
---|---|---|
ServerTimingOptions | options | The ServerTimingOptions to modify. |
System.Net.IPAddress | lowerInclusive | The lower (inclusive) bound of the IP addresses range. |
System.Net.IPAddress | upperInclusive | The upper (inclusive) bound of the IP addresses range. |
RestrictMetricsToIpRange(ServerTimingOptions, String, String)
Adds IServerTimingMetricFilter<TContext> which will remove all metrics unless request comes from IP address which falls within the specified range.
Declaration
public static void RestrictMetricsToIpRange(this ServerTimingOptions options, string lowerInclusive, string upperInclusive)
Parameters
Type | Name | Description |
---|---|---|
ServerTimingOptions | options | The ServerTimingOptions to modify. |
System.String | lowerInclusive | The lower (inclusive) bound of the IP addresses range. |
System.String | upperInclusive | The upper (inclusive) bound of the IP addresses range. |