Sha256: e16bbe4fa9d370299fb1d7f46a5e2c33ce89b3c6542b84030b749ca637161a53

Contents?: true

Size: 572 Bytes

Versions: 27

Compression:

Stored size: 572 Bytes

Contents

module Appsignal
  class Hooks
    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

27 entries across 27 versions & 1 rubygems

Version Path
appsignal-2.0.6 lib/appsignal/hooks/redis.rb
appsignal-2.0.5 lib/appsignal/hooks/redis.rb
appsignal-2.0.5.beta.1 lib/appsignal/hooks/redis.rb
appsignal-2.1.0.alpha.3 lib/appsignal/hooks/redis.rb
appsignal-2.1.0.alpha.2 lib/appsignal/hooks/redis.rb
appsignal-2.1.0.alpha.1 lib/appsignal/hooks/redis.rb
appsignal-2.0.4 lib/appsignal/hooks/redis.rb
appsignal-2.0.3 lib/appsignal/hooks/redis.rb
appsignal-2.0.2 lib/appsignal/hooks/redis.rb
appsignal-2.0.1 lib/appsignal/hooks/redis.rb
appsignal-2.0.0 lib/appsignal/hooks/redis.rb
appsignal-2.0.0.beta.1 lib/appsignal/hooks/redis.rb
appsignal-1.4.0.beta.1 lib/appsignal/hooks/redis.rb
appsignal-1.3.6 lib/appsignal/hooks/redis.rb
appsignal-1.3.6.beta.1 lib/appsignal/hooks/redis.rb
appsignal-1.3.5 lib/appsignal/hooks/redis.rb
appsignal-1.3.5.beta.1 lib/appsignal/hooks/redis.rb
appsignal-1.3.4 lib/appsignal/hooks/redis.rb
appsignal-1.3.3 lib/appsignal/hooks/redis.rb
appsignal-1.4.0.alpha.2 lib/appsignal/hooks/redis.rb