Class: OpenTelemetry::SDK::Metrics::Aggregation::AggregationTemporality

Inherits:
Object
  • Object
show all
Defined in:
lib/opentelemetry/sdk/metrics/aggregation/aggregation_temporality.rb

Overview

AggregationTemporality represents the temporality of data point (NumberDataPoint and HistogramDataPoint) in OpenTelemetry::SDK::Metrics. It determine whether the data point will be cleared for each metrics pull/export.

Constant Summary collapse

DELTA =

delta: data point will be cleared after each metrics pull/export.

:delta
CUMULATIVE =

cumulative: data point will NOT be cleared after metrics pull/export.

:cumulative

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(temporality) ⇒ AggregationTemporality

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

The constructor is private and only for use internally by the class. Users should use the delta and cumulative factory methods to obtain a OpenTelemetry::SDK::Metrics::Aggregation::AggregationTemporality instance.

Parameters:

  • temporality (Integer)

    One of the status codes below



41
42
43
# File 'lib/opentelemetry/sdk/metrics/aggregation/aggregation_temporality.rb', line 41

def initialize(temporality)
  @temporality = temporality
end

Instance Attribute Details

#temporalityObject (readonly)

Returns the value of attribute temporality.



33
34
35
# File 'lib/opentelemetry/sdk/metrics/aggregation/aggregation_temporality.rb', line 33

def temporality
  @temporality
end

Class Method Details

.cumulativeAggregationTemporality

Returns a newly created OpenTelemetry::SDK::Metrics::Aggregation::AggregationTemporality with temporality == CUMULATIVE



28
29
30
# File 'lib/opentelemetry/sdk/metrics/aggregation/aggregation_temporality.rb', line 28

def cumulative
  new(CUMULATIVE)
end

.deltaAggregationTemporality

Returns a newly created OpenTelemetry::SDK::Metrics::Aggregation::AggregationTemporality with temporality == DELTA



21
22
23
# File 'lib/opentelemetry/sdk/metrics/aggregation/aggregation_temporality.rb', line 21

def delta
  new(DELTA)
end

Instance Method Details

#cumulative?Boolean

Returns:

  • (Boolean)


49
50
51
# File 'lib/opentelemetry/sdk/metrics/aggregation/aggregation_temporality.rb', line 49

def cumulative?
  @temporality == :cumulative
end

#delta?Boolean

Returns:

  • (Boolean)


45
46
47
# File 'lib/opentelemetry/sdk/metrics/aggregation/aggregation_temporality.rb', line 45

def delta?
  @temporality == :delta
end