Table of Contents

Class ServerTimingOptions

Namespace
Cuemon.AspNetCore.Diagnostics
Assembly
Cuemon.AspNetCore.dll

Configuration options for ServerTimingMiddleware and related.

public class ServerTimingOptions : TimeMeasureOptions, IValidatableParameterObject, IParameterObject
Inheritance
Object
ServerTimingOptions
Implements
Inherited Members

Constructors

ServerTimingOptions()

Initializes a new instance of the ServerTimingOptions class.

public ServerTimingOptions()

Remarks

The following table shows the initial property values for an instance of ServerTimingOptions.

PropertyInitial Value
TimeMeasureCompletedThresholdSystem.TimeSpan.Zero
LogLevelSelectormetric => metric.Duration.HasValue ? LogLevel.Debug : LogLevel.None
SuppressHeaderPredicateenvironment => environment.IsProduction()
UseTimeMeasureProfilerfalse

Properties

LogLevelSelector

Gets or sets the function delegate that determines the Microsoft.Extensions.Logging.LogLevel for a given ServerTimingMetric.

public Func<ServerTimingMetric, LogLevel> LogLevelSelector { get; set; }

Property Value

Func<ServerTimingMetric, LogLevel>

The function delegate that determines the Microsoft.Extensions.Logging.LogLevel for a given ServerTimingMetric.

SuppressHeaderPredicate

Gets or sets the predicate that can suppress the Server-Timing HTTP header(s).

public Func<IHostEnvironment, bool> SuppressHeaderPredicate { get; set; }

Property Value

Func<IHostEnvironment, Boolean>

The function delegate that can determine if the Server-Timing HTTP header(s) should be suppressed.

UseTimeMeasureProfiler

Gets or sets a value indicating whether to apply TimeMeasureProfiler automatically on action methods in a Controller.

public bool UseTimeMeasureProfiler { get; set; }

Property Value

Boolean

true if action methods in a Controller should time measuring automatically; otherwise, false.

Remarks

This property is only used in the context of a Global Filter for MVC.

Methods

ValidateOptions()

Determines whether the public read-write properties of this instance are in a valid state.

public void ValidateOptions()

Remarks

This method is expected to throw exceptions when one or more conditions fails to be in a valid state.

Exceptions

System.InvalidOperationException

SuppressHeaderPredicate cannot be null.

See Also