Sha256: fbcae27a05485d50941a6f1a44dc2e8329eed37b4db2786236afe42b7e2b357e

Contents?: true

Size: 591 Bytes

Versions: 19

Compression:

Stored size: 591 Bytes

Contents

module Appsignal
  class Hooks
    # @api private
    class RedisHook < Appsignal::Hooks::Hook
      register :redis

      def dependencies_present?
        defined?(::Redis) &&
          Appsignal.config &&
          Appsignal.config[:instrument_redis]
      end

      def install
        ::Redis::Client.class_eval do
          alias process_without_appsignal process

          def process(commands, &block)
            Appsignal.instrument "query.redis" do
              process_without_appsignal(commands, &block)
            end
          end
        end
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
appsignal-2.4.2 lib/appsignal/hooks/redis.rb
appsignal-2.4.1 lib/appsignal/hooks/redis.rb
appsignal-2.4.0 lib/appsignal/hooks/redis.rb
appsignal-2.4.0.alpha.1 lib/appsignal/hooks/redis.rb
appsignal-2.3.7 lib/appsignal/hooks/redis.rb
appsignal-2.3.6 lib/appsignal/hooks/redis.rb
appsignal-2.3.6.beta.1 lib/appsignal/hooks/redis.rb
appsignal-2.3.4 lib/appsignal/hooks/redis.rb
appsignal-2.3.3 lib/appsignal/hooks/redis.rb
appsignal-2.3.3.beta.1 lib/appsignal/hooks/redis.rb
appsignal-2.3.2 lib/appsignal/hooks/redis.rb
appsignal-2.3.1 lib/appsignal/hooks/redis.rb
appsignal-2.3.0 lib/appsignal/hooks/redis.rb
appsignal-2.3.0.beta.3 lib/appsignal/hooks/redis.rb
appsignal-2.3.0.beta.2 lib/appsignal/hooks/redis.rb
appsignal-2.3.0.beta.1 lib/appsignal/hooks/redis.rb
appsignal-2.2.1 lib/appsignal/hooks/redis.rb
appsignal-2.2.0 lib/appsignal/hooks/redis.rb
appsignal-2.2.0.beta.1 lib/appsignal/hooks/redis.rb