Class: Temporalio::Metric::Meter

Inherits:
Object
  • Object
show all
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.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.nullMeter



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.

Raises:

  • (NotImplementedError)


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.

Raises:

  • (NotImplementedError)


104
105
106
# File 'lib/temporalio/metric.rb', line 104

def with_additional_attributes(additional_attributes)
  raise NotImplementedError
end