Sha256: c4a8a438997be323f30954c9d3fbcb480078b8c4d34a2a6fe706eae9f63bc774

Contents?: true

Size: 1.31 KB

Versions: 7

Compression:

Stored size: 1.31 KB

Contents

# frozen_string_literal: true

# Copyright The 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

7 entries across 7 versions & 1 rubygems

Version Path
opentelemetry-api-0.16.0 lib/opentelemetry/metrics/handles.rb
opentelemetry-api-0.15.0 lib/opentelemetry/metrics/handles.rb
opentelemetry-api-0.14.0 lib/opentelemetry/metrics/handles.rb
opentelemetry-api-0.13.0 lib/opentelemetry/metrics/handles.rb
opentelemetry-api-0.12.1 lib/opentelemetry/metrics/handles.rb
opentelemetry-api-0.12.0 lib/opentelemetry/metrics/handles.rb
opentelemetry-api-0.11.0 lib/opentelemetry/metrics/handles.rb