Class CounterAttribute<T>

Namespace
Cratis.Metrics
Assembly
Cratis.Fundamentals.dll

Attribute for marking a method as a counter for the metrics code generator.

[AttributeUsage(AttributeTargets.Method)]
public sealed class CounterAttribute<T> : Attribute

Type Parameters

T

Type of counter.

Inheritance
CounterAttribute<T>
Inherited Members
Extension Methods

Remarks

Counter is an Instrument which supports non-negative increments.

Constructors

CounterAttribute(string, string)

Initializes a new instance of the CounterAttribute<T> class without a unit.

public CounterAttribute(string name, string description)

Parameters

name string

Name of the counter.

description string

Description of the counter.

CounterAttribute(string, string, string?)

Attribute for marking a method as a counter for the metrics code generator.

public CounterAttribute(string name, string description, string? unit)

Parameters

name string

Name of the counter.

description string

Description of the counter.

unit string

UCUM unit of the counter.

Remarks

Counter is an Instrument which supports non-negative increments.

Properties

Description

Gets the description of the counter.

public string Description { get; }

Property Value

string

Name

Gets the name of the counter.

public string Name { get; }

Property Value

string

Unit

Gets the UCUM unit of the counter.

public string? Unit { get; }

Property Value

string