Class: OpenTelemetry::SDK::Metrics::Export::MetricReader

Inherits:
Object
  • Object
show all
Defined in:
lib/opentelemetry/sdk/metrics/export/metric_reader.rb

Overview

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.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeMetricReader

Returns a new instance of MetricReader.



17
18
19
# File 'lib/opentelemetry/sdk/metrics/export/metric_reader.rb', line 17

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

Instance Attribute Details

#metric_storeObject (readonly)

Returns the value of attribute metric_store.



15
16
17
# File 'lib/opentelemetry/sdk/metrics/export/metric_reader.rb', line 15

def metric_store
  @metric_store
end

Instance Method Details

#collectObject



21
22
23
# File 'lib/opentelemetry/sdk/metrics/export/metric_reader.rb', line 21

def collect
  @metric_store.collect
end

#force_flush(timeout: nil) ⇒ Object



29
30
31
# File 'lib/opentelemetry/sdk/metrics/export/metric_reader.rb', line 29

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

#shutdown(timeout: nil) ⇒ Object



25
26
27
# File 'lib/opentelemetry/sdk/metrics/export/metric_reader.rb', line 25

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