Class PerformanceDiagnoser
- Namespace
- Utils.Common
- Assembly
- Utils.Common.dll
Allows to track performance time of critical methods
Stores all execution times for a Interval
public class PerformanceDiagnoser
- Inheritance
-
objectPerformanceDiagnoser
- Extension Methods
Constructors
PerformanceDiagnoser(Action<string, int>?)
Creates a disabled diagnoser.
Added in ATAS 8.0.15.
public PerformanceDiagnoser(Action<string, int>? slowActionCallback = null)
Parameters
slowActionCallbackAction<string, int>Called with the measurement name and its duration in milliseconds when a measurement exceeds SlowTimeThreshold; runs on the thread that ends the measurement. Null for no callback.
Properties
Counters
Gets list of all tracked objects
public ConcurrentDictionary<string, MovingAverage> Counters { get; }
Property Value
- ConcurrentDictionary<string, MovingAverage>
Enabled
Whether measurements are recorded; false by default, so a new instance records nothing until it is enabled. Disabling clears Counters.
public bool Enabled { get; set; }
Property Value
- bool
Interval
How long to track the history
public TimeSpan Interval { get; set; }
Property Value
- TimeSpan
SlowTimeThreshold
Gets or sets time in milliseconds when to fire callback
If some of measurements will exceed this value
Use 0 to disable callbacks
public int SlowTimeThreshold { get; set; }
Property Value
- int
Methods
Measure(string)
Returns lightweight tracker object. This object must be used in using clause
public PerfCounter Measure(string caller)
Parameters
callerstring