Skip to content

_AspNet_Mvc_PerformanceMeasurementFilterAttribute

Michael Powell edited this page Feb 6, 2017 · 3 revisions

MeasureIt.Web.Mvc.Filters.PerformanceMeasurementFilterAttribute

The PerformanceMeasurementFilterAttribute exposes several constructor parameters as well as properties.

Attribute usage

Parameter / Attribute Values
validOn AttributeTargets.Method
AllowMultiple true
Inherited true (default)

Constructor parameters

Parameter Type Description
prefix System.String Prefix for the name (defaults to fully qualified method signature)
categoryType System.Type Performance counter category type
adapterType System.Type Performance counter adapter type
otherAdapterTypes System.Type[] (params) Additional performance counter adapter types

Properties

Property Type Default Description
ReadOnly System.Boolean (underlying, System.Nullable<System.Boolean> false
InstanceLifetime System.Diagnostics.PerformanceCounterInstanceLifetime Process
PublishCounters System.Boolean true
ThrowPublishErrors System.Boolean false
PublishEvent System.Boolean true
SampleRate System.Double 1.0
Boundary MeasureIt.Discovery.MeasurementBoundary[] new MeasurementBoundary[] {BeginAction, EndAction}

Remarks

Multiple performance measurements may decorate a single method. Additionally, performance measurements found in derived classes overshadow those found in base classes.

MeasurementBoundary is a key difference between the ASP.NET MVC measurements and the ad-hoc and ASP.NET Web API. We allow boundaries to be specified around begin/end and/or action/result.