Class ServerTimingAttribute
- 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
-
ActionFilterAttributeServerTimingAttribute
- Implements
-
IActionFilterIAsyncActionFilterIResultFilterIAsyncResultFilterIOrderedFilterIFilterFactoryIFilterMetadata
- Inherited Members
-
ActionFilterAttribute.OnActionExecuting(ActionExecutingContext)ActionFilterAttribute.OnActionExecuted(ActionExecutedContext)ActionFilterAttribute.OnActionExecutionAsync(ActionExecutingContext, ActionExecutionDelegate)ActionFilterAttribute.OnResultExecuting(ResultExecutingContext)ActionFilterAttribute.OnResultExecuted(ResultExecutedContext)ActionFilterAttribute.OnResultExecutionAsync(ResultExecutingContext, ResultExecutionDelegate)ActionFilterAttribute.Order
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 Microsoft.AspNetCore.Mvc.Filters.IFilterFactory.CreateInstance(System.IServiceProvider) can be reused across requests.
public bool IsReusable { get; }
Property Value
- Boolean
true
if 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
serviceProvider
IServiceProviderThe request IServiceProvider.
Returns
- IFilterMetadata
An instance of the executable filter.