Class: Counter
This represents the metric type - counter, that can be only increased by an integer number.
Constructor
This instantiates the Counter object. Name field is mandatory, and description and tags fields are optional and have its own default values when no params are passed.
init (string name, string? desc, map<string>? tags)
Methods
register | Register the counter metric instance with the Metric Registry. |
unregister | Unregister the counter metric instance with the Metric Registry. |
increment | Increment the counter's value by an amount. |
reset | Resets the counter's value to zero. |
getValue | Retrieves the counter's current value. |
Fields
unregister
function unregister()
Unregister the counter metric instance with the Metric Registry.
reset
function reset()
Resets the counter's value to zero.