Sha256: fb3c08b4972641a5bb86f3535aa2cf908133874344dbd5c1cbcfe9155e42090a

Contents?: true

Size: 853 Bytes

Versions: 4

Compression:

Stored size: 853 Bytes

Contents

# frozen_string_literal: true

# Copyright The OpenTelemetry Authors
#
# SPDX-License-Identifier: Apache-2.0

module OpenTelemetry
  module SDK
    module Metrics
      module Aggregation
        # Contains the implementation of the Drop aggregation
        class Drop
          attr_reader :aggregation_temporality

          def initialize(aggregation_temporality: :delta)
            @aggregation_temporality = aggregation_temporality
          end

          def collect(start_time, end_time, data_points)
            data_points.values.map!(&:dup)
          end

          def update(increment, attributes, data_points)
            data_points[attributes] = NumberDataPoint.new(
              {},
              0,
              0,
              0,
              0
            )
            nil
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
opentelemetry-metrics-sdk-0.5.0 lib/opentelemetry/sdk/metrics/aggregation/drop.rb
opentelemetry-metrics-sdk-0.4.1 lib/opentelemetry/sdk/metrics/aggregation/drop.rb
opentelemetry-metrics-sdk-0.4.0 lib/opentelemetry/sdk/metrics/aggregation/drop.rb
opentelemetry-metrics-sdk-0.3.0 lib/opentelemetry/sdk/metrics/aggregation/drop.rb