Class ServerTimingAttribute
- Namespace
- Cuemon.AspNetCore.Mvc.Filters.Diagnostics
- Assembly
- Cuemon.AspNetCore.Mvc.dll
Represents an attribute that is used to mark an action method for time measure profiling.
public class ServerTimingAttribute : ActionFilterAttribute, IActionFilter, IAsyncActionFilter, IResultFilter, IAsyncResultFilter, IOrderedFilter, IFilterFactory, IFilterMetadata- Inheritance
- 
      
      
      
      ServerTimingAttribute
- Implements
- Inherited Members
Constructors
ServerTimingAttribute()
Initializes a new instance of the ServerTimingAttribute class.
public ServerTimingAttribute()Properties
Description
Gets or sets the server-specified metric description. Defaults the request URI of the action method.
public string Description { get; set; }Property Value
- string
- The server-specified metric description. 
DesiredLogLevel
Gets or sets the LogLevel of server-timing metrics. Defaults to Debug, which means logs are written with a severity level of debug.
public LogLevel DesiredLogLevel { get; set; }Property Value
EnvironmentName
Gets or sets the name of the environment to suppress the Server-Timing header from. Default is "Production".
public string EnvironmentName { get; set; }Property Value
- string
- The name of the environment to suppress the Server-Timing header from. 
Remarks
To always include the Server-Timing header, set this property to null or an empty string.
IsReusable
Gets a value that indicates if the result of CreateInstance(IServiceProvider) can be reused across requests.
public bool IsReusable { get; }Property Value
- bool
- trueif this instance is reusable; otherwise,- false.
Name
Gets or sets the server-specified metric name. Defaults to the name of the action method.
public string Name { get; set; }Property Value
- string
- The server-specified metric name. 
Threshold
Gets or sets the value that in combination with ThresholdTimeUnit specifies the threshold of the action method.
public double Threshold { get; set; }Property Value
- double
- The threshold value of the action method. 
ThresholdTimeUnit
Gets or sets one of the enumeration values that specifies the time unit of Threshold.
public TimeUnit ThresholdTimeUnit { get; set; }Property Value
Methods
CreateInstance(IServiceProvider)
Creates an instance of the executable filter.
public IFilterMetadata CreateInstance(IServiceProvider serviceProvider)Parameters
- serviceProviderIServiceProvider
- The request IServiceProvider. 
Returns
- IFilterMetadata
- An instance of the executable filter.