Sha256: e900da10a9e8728b7d8487804452829813e7edafdd6144df89aba834b6367070

Contents?: true

Size: 851 Bytes

Versions: 6

Compression:

Stored size: 851 Bytes

Contents

# frozen_string_literal: true

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

module OpenTelemetry
  module SDK
    module Metrics
      module Export
        # MetricReader provides a minimal example implementation.
        # It is not required to subclass this class to provide an implementation
        # of MetricReader, provided the interface is satisfied.
        class MetricReader
          attr_reader :metric_store

          def initialize
            @metric_store = OpenTelemetry::SDK::Metrics::State::MetricStore.new
          end

          def collect
            @metric_store.collect
          end

          def shutdown(timeout: nil)
            Export::SUCCESS
          end

          def force_flush(timeout: nil)
            Export::SUCCESS
          end
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
opentelemetry-metrics-sdk-0.5.0 lib/opentelemetry/sdk/metrics/export/metric_reader.rb
opentelemetry-metrics-sdk-0.4.1 lib/opentelemetry/sdk/metrics/export/metric_reader.rb
opentelemetry-metrics-sdk-0.4.0 lib/opentelemetry/sdk/metrics/export/metric_reader.rb
opentelemetry-metrics-sdk-0.3.0 lib/opentelemetry/sdk/metrics/export/metric_reader.rb
opentelemetry-metrics-sdk-0.2.0 lib/opentelemetry/sdk/metrics/export/metric_reader.rb
opentelemetry-metrics-sdk-0.1.0 lib/opentelemetry/sdk/metrics/export/metric_reader.rb