Sha256: 496be9de3351b9693a7b03f16c435cf20186ec6395c02dc34f63cdb49c5a3254

Contents?: true

Size: 1.31 KB

Versions: 9

Compression:

Stored size: 1.31 KB

Contents

# frozen_string_literal: true

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

module OpenTelemetry
  module Metrics
    # In situations where performance is a requirement and a metric is
    # repeatedly used with the same labels, the developer may elect to
    # use instrument {Handles} as an optimization. For handles to be a benefit,
    # it requires that a specific instrument will be re-used with specific
    # labels. If an instrument will be used with the same labels more than
    # once, obtaining an instrument handle corresponding to the labels
    # ensures the highest performance available.
    #
    # To obtain a handle given an instrument and labels, use the  #handle
    # method to return an interface that supports the #add or #record
    # method of the instrument in question.
    #
    # Instrument handles may consume SDK resources indefinitely.
    module Handles
      # A float counter handle.
      class FloatCounter
        def add(value); end
      end

      # An integer counter handle.
      class IntegerCounter
        def add(value); end
      end

      # A float measure handle.
      class FloatMeasure
        def record(value); end
      end

      # An integer measure handle.
      class IntegerMeasure
        def record(value); end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
opentelemetry-api-0.10.0 lib/opentelemetry/metrics/handles.rb
opentelemetry-api-0.9.0 lib/opentelemetry/metrics/handles.rb
opentelemetry-api-0.8.0 lib/opentelemetry/metrics/handles.rb
opentelemetry-api-0.7.0 lib/opentelemetry/metrics/handles.rb
opentelemetry-api-0.6.0 lib/opentelemetry/metrics/handles.rb
opentelemetry-api-0.5.1 lib/opentelemetry/metrics/handles.rb
opentelemetry-api-0.5.0 lib/opentelemetry/metrics/handles.rb
opentelemetry-api-0.4.0 lib/opentelemetry/metrics/handles.rb
opentelemetry-api-0.3.0 lib/opentelemetry/metrics/handles.rb