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
TType 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
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
namestringName of the counter.
descriptionstringDescription of the counter.
unitstringUCUM 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
Name
Gets the name of the counter.
public string Name { get; }
Property Value
Unit
Gets the UCUM unit of the counter.
public string? Unit { get; }