class documentation
class MetricCounter(ABC): (source)
Known subclasses: temporalio.common._NoopMetricCounter
, temporalio.runtime._MetricCounter
, temporalio.worker._workflow_instance._ReplaySafeMetricCounter
Counter metric created by a metric meter.
Method | add |
Add a value to the counter. |
Method | with |
Create a new counter with the given attributes appended to the current set. |
Property | description |
Description for the metric if any. |
Property | name |
Name for the metric. |
Property | unit |
Unit for the metric if any. |
@abstractmethod
def add(self, value:
def add(self, value:
int
, additional_attributes: Optional[ MetricAttributes]
= None):
(source)
¶
overridden in
temporalio.common._NoopMetricCounter
, temporalio.runtime._MetricCounter
, temporalio.worker._workflow_instance._ReplaySafeMetricCounter
Add a value to the counter.
Parameters | |
value:int | A non-negative integer to add. |
additionalOptional[ | Additional attributes to append to the current set. |
Raises | |
ValueError | Value is negative. |
TypeError | Attribute values are not the expected type. |
@abstractmethod
def with_additional_attributes(self, additional_attributes:
def with_additional_attributes(self, additional_attributes:
MetricAttributes
) -> MetricCounter
:
(source)
¶
overridden in
temporalio.common._NoopMetricCounter
, temporalio.runtime._MetricCounter
, temporalio.worker._workflow_instance._ReplaySafeMetricCounter
Create a new counter with the given attributes appended to the current set.
Parameters | |
additionalMetricAttributes | Additional attributes to append to the current set. |
Returns | |
MetricCounter | New counter. |
Raises | |
TypeError | Attribute values are not the expected type. |
overridden in
temporalio.runtime._MetricCounter
, temporalio.worker._workflow_instance._ReplaySafeMetricCounter
Description for the metric if any.
overridden in
temporalio.runtime._MetricCounter
, temporalio.worker._workflow_instance._ReplaySafeMetricCounter
Name for the metric.
overridden in
temporalio.runtime._MetricCounter
, temporalio.worker._workflow_instance._ReplaySafeMetricCounter
Unit for the metric if any.