yr.DoubleCounter

Contents

yr.DoubleCounter#

class yr.DoubleCounter(name: str, description: str, unit: str, labels: ~typing.Dict[str, str] = Field(name=None, type=None, default=<dataclasses._MISSING_TYPE object>, default_factory=<class 'dict'>, init=True, repr=True, hash=None, compare=True, metadata=mappingproxy({}), _field_type=None))[source]#

Bases: Metrics

Initialize the double counter.

Parameters:
  • name (str) – The name of the counter.

  • description (str) – The description of the counter.

  • unit (str) – unit.

  • labels (Dict[str, str], optional) – Labels for the counter, defaults to an empty dictionary.

Methods

__init__

add_labels

add lable for metrics data.

get_value

Get value of double counter.

increase

Increase double counter to the given value.

reset

Reset double counter.

set

Set double counter to the given value.