Class DefaultTimerMetric
Inheritance
System.Object
DefaultTimerMetric
Namespace:App.Metrics.Timer
Assembly:cs.temp.dll.dll
Syntax
public sealed class DefaultTimerMetric : ITimerMetric, IDisposable
Constructors
DefaultTimerMetric(IHistogramMetric, IClock)
Declaration
public DefaultTimerMetric(IHistogramMetric histogram, IClock clock)
Parameters
Type |
Name |
Description |
IHistogramMetric |
histogram |
The histogram implementation to use.
|
IClock |
clock |
The clock to use to measure processing duration.
|
DefaultTimerMetric(IHistogramMetric, IMeterMetric, IClock)
Declaration
public DefaultTimerMetric(IHistogramMetric histogram, IMeterMetric meter, IClock clock)
Parameters
Type |
Name |
Description |
IHistogramMetric |
histogram |
The histogram implementation to use.
|
IMeterMetric |
meter |
The meter implementation to use to genreate the rate of events over time.
|
IClock |
clock |
The clock to use to measure processing duration.
|
DefaultTimerMetric(IReservoir, IClock)
Declaration
public DefaultTimerMetric(IReservoir reservoir, IClock clock)
Parameters
Type |
Name |
Description |
IReservoir |
reservoir |
The reservoir implementation to use for sampling values to generate the histogram.
|
IClock |
clock |
The clock to use to measure processing duration.
|
DefaultTimerMetric(IReservoir, IMeterMetric, IClock)
Declaration
public DefaultTimerMetric(IReservoir reservoir, IMeterMetric meter, IClock clock)
Parameters
Type |
Name |
Description |
IReservoir |
reservoir |
The reservoir to use for sampling within the histogram.
|
IMeterMetric |
meter |
The meter implementation to use to genreate the rate of events over time.
|
IClock |
clock |
The clock to use to measure processing duration.
|
Properties
Value
Declaration
public TimerValue Value { get; }
Property Value
Methods
CurrentTime()
Declaration
public long CurrentTime()
Returns
Type |
Description |
System.Int64 |
|
Dispose()
Declaration
Implements
System.IDisposable.Dispose()
Dispose(Boolean)
Declaration
public void Dispose(bool disposing)
Parameters
Type |
Name |
Description |
System.Boolean |
disposing |
|
EndRecording()
Declaration
public long EndRecording()
Returns
Type |
Description |
System.Int64 |
|
GetValue(Boolean)
Declaration
public TimerValue GetValue(bool resetMetric = false)
Parameters
Type |
Name |
Description |
System.Boolean |
resetMetric |
|
Returns
NewContext()
Declaration
public TimerContext NewContext()
Returns
NewContext(String)
Declaration
public TimerContext NewContext(string userValue)
Parameters
Type |
Name |
Description |
System.String |
userValue |
|
Returns
Record(Int64, TimeUnit)
Declaration
public void Record(long time, TimeUnit unit)
Parameters
Type |
Name |
Description |
System.Int64 |
time |
|
TimeUnit |
unit |
|
Record(Int64, TimeUnit, String)
Declaration
public void Record(long duration, TimeUnit unit, string userValue)
Parameters
Type |
Name |
Description |
System.Int64 |
duration |
|
TimeUnit |
unit |
|
System.String |
userValue |
|
Reset()
Declaration
StartRecording()
Declaration
public long StartRecording()
Returns
Type |
Description |
System.Int64 |
|
Time(Action)
Declaration
public void Time(Action action)
Parameters
Type |
Name |
Description |
System.Action |
action |
|
Time(Action, String)
Declaration
public void Time(Action action, string userValue)
Parameters
Type |
Name |
Description |
System.Action |
action |
|
System.String |
userValue |
|
Time<T>(Func<T>)
Declaration
public T Time<T>(Func<T> action)
Parameters
Type |
Name |
Description |
System.Func<T> |
action |
|
Returns
Type Parameters
Time<T>(Func<T>, String)
Declaration
public T Time<T>(Func<T> action, string userValue)
Parameters
Type |
Name |
Description |
System.Func<T> |
action |
|
System.String |
userValue |
|
Returns
Type Parameters