Sha256: d110a0a6184113f293d75f4bd590dd0d3bded987d4a0864b0bde7c1da89476a7

Contents?: true

Size: 801 Bytes

Versions: 5

Compression:

Stored size: 801 Bytes

Contents

require "nunes/adapter"

module Nunes
  module Adapters
    # Internal: Adapter that aliases timing to gauge. One of the supported
    # places to send instrumentation data is instrumentalapp.com. Their agent
    # uses gauge under the hood for timing information. This adapter is used to
    # adapter their gauge interface to the timing one used internally in the
    # gem. This should never need to be used directly by a user of the gem.
    class TimingAliased < ::Nunes::Adapter
      def self.wraps?(client)
        client.respond_to?(:increment) &&
          client.respond_to?(:gauge) &&
          !client.respond_to?(:timing)
      end

      # Internal: Adapter timing to gauge.
      def timing(metric, duration)
        @client.gauge prepare(metric), duration
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
nunes-0.5.0 lib/nunes/adapters/timing_aliased.rb
nunes-0.4.0 lib/nunes/adapters/timing_aliased.rb
nunes-0.3.1 lib/nunes/adapters/timing_aliased.rb
nunes-0.3.0 lib/nunes/adapters/timing_aliased.rb
nunes-0.2.0 lib/nunes/adapters/timing_aliased.rb