C# Class DotNetWorkQueue.Metrics.Net.MetricsContext

Represents a logical grouping of metrics
Inheritance: IMetricsContext
Exibir arquivo Open project: blehnen/DotNetWorkQueue

Public Methods

Method Description
Context ( string contextName ) : IMetricsContext

Create a new child metrics context. Metrics added to the child context are kept separate from the metrics in the parent context.

Counter ( string name, Units unit, string tag = null ) : ICounter

A counter is a simple incrementing and decrementing 64-bit integer. Ex number of active requests.

Counter ( string name, string unitName, string tag = null ) : ICounter

A counter is a simple incrementing and decrementing 64-bit integer. Ex number of active requests.

Dispose ( ) : void

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Gauge ( string name, Func valueProvider, Units unit, string tag = null ) : void

A gauge is the simplest metric type. It just returns a value. This metric is suitable for instantaneous values.

Histogram ( string name, Units unit, SamplingTypes samplingType = SamplingTypes.FavorRecent, string tag = null ) : IHistogram

A Histogram measures the distribution of values in a stream of data: e.g., the number of results returned by a search.

Meter ( string name, Units unit, TimeUnits rateUnit = TimeUnits.Seconds, string tag = null ) : IMeter

A meter measures the rate at which a set of events occur, in a few different ways. This metric is suitable for keeping a record of now often something happens ( error, request etc ).

The mean rate is the average rate of events. It’s generally useful for trivia, but as it represents the total rate for your application’s entire lifetime (e.g., the total number of requests handled, divided by the number of seconds the process has been running), it does not offer a sense of recency. Luckily, meters also record three different exponentially-weighted moving average rates: the 1-, 5-, and 15-minute moving averages.

Meter ( string name, string unitName, TimeUnits rateUnit, string tag = null ) : IMeter

A meter measures the rate at which a set of events occur, in a few different ways. This metric is suitable for keeping a record of now often something happens ( error, request etc ).

The mean rate is the average rate of events. It’s generally useful for trivia, but as it represents the total rate for your application’s entire lifetime (e.g., the total number of requests handled, divided by the number of seconds the process has been running), it does not offer a sense of recency. Luckily, meters also record three different exponentially-weighted moving average rates: the 1-, 5-, and 15-minute moving averages.

MetricsContext ( global context ) : System

Initializes a new instance of the MetricsContext class.

ShutdownContext ( string contextName ) : void

Remove a child context. The metrics for the child context are removed from the MetricsData of the parent context.

Timer ( string name, Units unit, SamplingTypes samplingType = SamplingTypes.FavorRecent, TimeUnits rateUnit = TimeUnits.Seconds, TimeUnits durationUnit = TimeUnits.Milliseconds, string tag = null ) : ITimer

A timer is basically a histogram of the duration of a type of event and a meter of the rate of its occurrence.

Method Details

Context() public method

Create a new child metrics context. Metrics added to the child context are kept separate from the metrics in the parent context.
public Context ( string contextName ) : IMetricsContext
contextName string Name of the child context.
return IMetricsContext

Counter() public method

A counter is a simple incrementing and decrementing 64-bit integer. Ex number of active requests.
public Counter ( string name, Units unit, string tag = null ) : ICounter
name string Name of the metric. Must be unique across all counters in this context.
unit Units Description of what the is being measured ( Unit.Requests , Unit.Items etc ) .
tag string Optional tag that can be associated with the metric.
return ICounter

Counter() public method

A counter is a simple incrementing and decrementing 64-bit integer. Ex number of active requests.
public Counter ( string name, string unitName, string tag = null ) : ICounter
name string Name of the metric. Must be unique across all counters in this context.
unitName string A Parent name; child counters can be added to this by specifying the this name
tag string Optional tag that can be associated with the metric.
return ICounter

Dispose() public method

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public Dispose ( ) : void
return void

Gauge() public method

A gauge is the simplest metric type. It just returns a value. This metric is suitable for instantaneous values.
public Gauge ( string name, Func valueProvider, Units unit, string tag = null ) : void
name string Name of this gauge metric. Must be unique across all gauges in this context.
valueProvider Func Function that returns the value for the gauge.
unit Units Description of want the value represents ( Unit.Requests , Unit.Items etc ) .
tag string Optional tag that can be associated with the metric.
return void

Histogram() public method

A Histogram measures the distribution of values in a stream of data: e.g., the number of results returned by a search.
public Histogram ( string name, Units unit, SamplingTypes samplingType = SamplingTypes.FavorRecent, string tag = null ) : IHistogram
name string Name of the metric. Must be unique across all histograms in this context.
unit Units Description of what the is being measured ( Unit.Requests , Unit.Items etc ) .
samplingType SamplingTypes Type of the sampling to use (see SamplingType for details ).
tag string Optional tag that can be associated with the metric.
return IHistogram

Meter() public method

A meter measures the rate at which a set of events occur, in a few different ways. This metric is suitable for keeping a record of now often something happens ( error, request etc ).
The mean rate is the average rate of events. It’s generally useful for trivia, but as it represents the total rate for your application’s entire lifetime (e.g., the total number of requests handled, divided by the number of seconds the process has been running), it does not offer a sense of recency. Luckily, meters also record three different exponentially-weighted moving average rates: the 1-, 5-, and 15-minute moving averages.
public Meter ( string name, Units unit, TimeUnits rateUnit = TimeUnits.Seconds, string tag = null ) : IMeter
name string Name of the metric. Must be unique across all meters in this context.
unit Units Description of what the is being measured ( Unit.Requests , Unit.Items etc ) .
rateUnit TimeUnits Time unit for rates reporting. Defaults to Second ( occurrences / second ).
tag string Optional tag that can be associated with the metric.
return IMeter

Meter() public method

A meter measures the rate at which a set of events occur, in a few different ways. This metric is suitable for keeping a record of now often something happens ( error, request etc ).
The mean rate is the average rate of events. It’s generally useful for trivia, but as it represents the total rate for your application’s entire lifetime (e.g., the total number of requests handled, divided by the number of seconds the process has been running), it does not offer a sense of recency. Luckily, meters also record three different exponentially-weighted moving average rates: the 1-, 5-, and 15-minute moving averages.
public Meter ( string name, string unitName, TimeUnits rateUnit, string tag = null ) : IMeter
name string Name of the metric. Must be unique across all meters in this context.
unitName string A Parent name; child counters can be added to this by specifying the this name
rateUnit TimeUnits Time unit for rates reporting. Defaults to Second ( occurrences / second ).
tag string Optional tag that can be associated with the metric.
return IMeter

MetricsContext() public method

Initializes a new instance of the MetricsContext class.
public MetricsContext ( global context ) : System
context global The context.
return System

ShutdownContext() public method

Remove a child context. The metrics for the child context are removed from the MetricsData of the parent context.
public ShutdownContext ( string contextName ) : void
contextName string Name of the child context to shutdown.
return void

Timer() public method

A timer is basically a histogram of the duration of a type of event and a meter of the rate of its occurrence.
public Timer ( string name, Units unit, SamplingTypes samplingType = SamplingTypes.FavorRecent, TimeUnits rateUnit = TimeUnits.Seconds, TimeUnits durationUnit = TimeUnits.Milliseconds, string tag = null ) : ITimer
name string Name of the metric. Must be unique across all timers in this context.
unit Units Description of what the is being measured ( Unit.Requests , Unit.Items etc ) .
samplingType SamplingTypes Type of the sampling to use (see SamplingType for details ).
rateUnit TimeUnits Time unit for rates reporting. Defaults to Second ( occurrences / second ).
durationUnit TimeUnits Time unit for reporting durations. Defaults to Milliseconds.
tag string Optional tag that can be associated with the metric.
return ITimer