Sha256: 017ac57ec7ef6ca5508811c09482bff82f3db20d2c2f9373e365100fc436120a

Contents?: true

Size: 519 Bytes

Versions: 3

Compression:

Stored size: 519 Bytes

Contents

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

3 entries across 3 versions & 1 rubygems

Version Path
ddtrace-1.10.1 lib/datadog/core/metrics/helpers.rb
ddtrace-1.10.0 lib/datadog/core/metrics/helpers.rb
ddtrace-1.0.0.beta1 lib/datadog/core/metrics/helpers.rb