Sha256: cad04b4f4e5010acb0297b10ae6dcbb8f79d0c6254da301234f778f1b5bae350

Contents?: true

Size: 550 Bytes

Versions: 35

Compression:

Stored size: 550 Bytes

Contents

# frozen_string_literal: true

module Datadog
  module Core
    module Metrics
      # For defining and adding helpers to metrics
      module Helpers
        [
          :count,
          :distribution,
          :increment,
          :gauge,
          :time
        ].each do |metric_type|
          define_method(metric_type) do |name, stat|
            name = name.to_sym
            define_method(name) do |*args, &block|
              send(metric_type, stat, *args, &block)
            end
          end
        end
      end
    end
  end
end

Version data entries

35 entries across 35 versions & 2 rubygems

Version Path
datadog-2.9.0 lib/datadog/core/metrics/helpers.rb
datadog-2.8.0 lib/datadog/core/metrics/helpers.rb
datadog-2.7.1 lib/datadog/core/metrics/helpers.rb
datadog-2.7.0 lib/datadog/core/metrics/helpers.rb
datadog-2.6.0 lib/datadog/core/metrics/helpers.rb
datadog-2.5.0 lib/datadog/core/metrics/helpers.rb
datadog-2.4.0 lib/datadog/core/metrics/helpers.rb
datadog-2.3.0 lib/datadog/core/metrics/helpers.rb
datadog-2.2.0 lib/datadog/core/metrics/helpers.rb
ddtrace-1.23.3 lib/datadog/core/metrics/helpers.rb
ddtrace-1.23.2 lib/datadog/core/metrics/helpers.rb
datadog-2.1.0 lib/datadog/core/metrics/helpers.rb
datadog-2.0.0 lib/datadog/core/metrics/helpers.rb
ddtrace-1.23.1 lib/datadog/core/metrics/helpers.rb
datadog-2.0.0.beta2 lib/datadog/core/metrics/helpers.rb
ddtrace-1.22.0 lib/datadog/core/metrics/helpers.rb
datadog-2.0.0.beta1 lib/datadog/core/metrics/helpers.rb
ddtrace-1.21.1 lib/datadog/core/metrics/helpers.rb
ddtrace-1.21.0 lib/datadog/core/metrics/helpers.rb
ddtrace-1.20.0 lib/datadog/core/metrics/helpers.rb