Class: Temporalio::Internal::Metric
- Defined in:
- lib/temporalio/internal/metric.rb
Defined Under Namespace
Classes: Meter, NullMeter, NullMetric
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#metric_type ⇒ Object
readonly
Returns the value of attribute metric_type.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#unit ⇒ Object
readonly
Returns the value of attribute unit.
-
#value_type ⇒ Object
readonly
Returns the value of attribute value_type.
Instance Method Summary collapse
-
#initialize(metric_type:, name:, description:, unit:, value_type:, bridge:, bridge_attrs:) ⇒ Metric
constructor
rubocop:disable Lint/MissingSuper.
- #record(value, additional_attributes: nil) ⇒ Object
- #with_additional_attributes(additional_attributes) ⇒ Object
Constructor Details
#initialize(metric_type:, name:, description:, unit:, value_type:, bridge:, bridge_attrs:) ⇒ Metric
rubocop:disable Lint/MissingSuper
12 13 14 15 16 17 18 19 20 |
# File 'lib/temporalio/internal/metric.rb', line 12 def initialize(metric_type:, name:, description:, unit:, value_type:, bridge:, bridge_attrs:) # rubocop:disable Lint/MissingSuper @metric_type = metric_type @name = name @description = description @unit = unit @value_type = value_type @bridge = bridge @bridge_attrs = bridge_attrs end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
10 11 12 |
# File 'lib/temporalio/internal/metric.rb', line 10 def description @description end |
#metric_type ⇒ Object (readonly)
Returns the value of attribute metric_type.
10 11 12 |
# File 'lib/temporalio/internal/metric.rb', line 10 def metric_type @metric_type end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
10 11 12 |
# File 'lib/temporalio/internal/metric.rb', line 10 def name @name end |
#unit ⇒ Object (readonly)
Returns the value of attribute unit.
10 11 12 |
# File 'lib/temporalio/internal/metric.rb', line 10 def unit @unit end |
#value_type ⇒ Object (readonly)
Returns the value of attribute value_type.
10 11 12 |
# File 'lib/temporalio/internal/metric.rb', line 10 def value_type @value_type end |
Instance Method Details
#record(value, additional_attributes: nil) ⇒ Object
22 23 24 25 26 |
# File 'lib/temporalio/internal/metric.rb', line 22 def record(value, additional_attributes: nil) bridge_attrs = @bridge_attrs bridge_attrs = @bridge_attrs.with_additional(additional_attributes) if additional_attributes @bridge.record_value(value, bridge_attrs) end |
#with_additional_attributes(additional_attributes) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/temporalio/internal/metric.rb', line 28 def with_additional_attributes(additional_attributes) Metric.new( metric_type:, name:, description:, unit:, value_type:, bridge: @bridge, bridge_attrs: @bridge_attrs.with_additional(additional_attributes) ) end |