Class: Temporalio::Metric::Meter
- Inherits:
-
Object
- Object
- Temporalio::Metric::Meter
- Defined in:
- lib/temporalio/metric.rb
Overview
Meter for creating metrics to record values on. This is obtained via workflow environment, activity context, or from the Runtime if in neither of those. This class is effectively abstract and will fail if ‘initialize` is attempted.
Direct Known Subclasses
Class Method Summary collapse
-
.null ⇒ Meter
A no-op instance of Meter.
Instance Method Summary collapse
-
#create_metric(metric_type, name, description: nil, unit: nil, value_type: :integer) ⇒ Metric
Create a new metric.
-
#with_additional_attributes(additional_attributes) ⇒ Meter
Create a copy of this meter but with the given additional attributes.
Class Method Details
.null ⇒ Meter
Returns A no-op instance of Temporalio::Metric::Meter.
66 67 68 |
# File 'lib/temporalio/metric.rb', line 66 def self.null Internal::Metric::NullMeter.instance end |
Instance Method Details
#create_metric(metric_type, name, description: nil, unit: nil, value_type: :integer) ⇒ Metric
Create a new metric. Only certain metric types are accepted and only value types can work with certain metric types.
88 89 90 91 92 93 94 95 96 |
# File 'lib/temporalio/metric.rb', line 88 def create_metric( metric_type, name, description: nil, unit: nil, value_type: :integer ) raise NotImplementedError end |
#with_additional_attributes(additional_attributes) ⇒ Meter
Create a copy of this meter but with the given additional attributes. This is more performant than providing attributes on each Temporalio::Metric#record call.
104 105 106 |
# File 'lib/temporalio/metric.rb', line 104 def with_additional_attributes(additional_attributes) raise NotImplementedError end |