Sha256: 408cef7aa1bd195fd2b49b6d97d513ad0737b7b57638643d32c7378df0daa92c

Contents?: true

Size: 535 Bytes

Versions: 16

Compression:

Stored size: 535 Bytes

Contents

# typed: false

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

16 entries across 16 versions & 1 rubygems

Version Path
ddtrace-1.9.0 lib/datadog/core/metrics/helpers.rb
ddtrace-1.8.0 lib/datadog/core/metrics/helpers.rb
ddtrace-1.7.0 lib/datadog/core/metrics/helpers.rb
ddtrace-1.6.1 lib/datadog/core/metrics/helpers.rb
ddtrace-1.6.0 lib/datadog/core/metrics/helpers.rb
ddtrace-1.5.2 lib/datadog/core/metrics/helpers.rb
ddtrace-1.5.1 lib/datadog/core/metrics/helpers.rb
ddtrace-1.5.0 lib/datadog/core/metrics/helpers.rb
ddtrace-1.4.2 lib/datadog/core/metrics/helpers.rb
ddtrace-1.4.1 lib/datadog/core/metrics/helpers.rb
ddtrace-1.4.0 lib/datadog/core/metrics/helpers.rb
ddtrace-1.3.0 lib/datadog/core/metrics/helpers.rb
ddtrace-1.2.0 lib/datadog/core/metrics/helpers.rb
ddtrace-1.1.0 lib/datadog/core/metrics/helpers.rb
ddtrace-1.0.0 lib/datadog/core/metrics/helpers.rb
ddtrace-1.0.0.beta2 lib/datadog/core/metrics/helpers.rb