Sha256: 470204e2103c3c9d0dde96820726a25ad3abe0705640d680180021eee79998e9

Contents?: true

Size: 592 Bytes

Versions: 88

Compression:

Stored size: 592 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)
            ActiveSupport::Notifications.instrument('query.redis') do
              process_without_appsignal(commands, &block)
            end
          end
        end
      end
    end
  end
end

Version data entries

88 entries across 88 versions & 1 rubygems

Version Path
appsignal-1.1.9 lib/appsignal/hooks/redis.rb
appsignal-1.1.9.beta.2 lib/appsignal/hooks/redis.rb
appsignal-1.1.9.beta.1 lib/appsignal/hooks/redis.rb
appsignal-1.1.8 lib/appsignal/hooks/redis.rb
appsignal-1.2.0.alpha.3 lib/appsignal/hooks/redis.rb
appsignal-1.1.7 lib/appsignal/hooks/redis.rb
appsignal-1.2.0.alpha.2 lib/appsignal/hooks/redis.rb
appsignal-1.1.7.beta.2 lib/appsignal/hooks/redis.rb
appsignal-1.2.0.alpha.1 lib/appsignal/hooks/redis.rb
appsignal-1.1.7.beta.1 lib/appsignal/hooks/redis.rb
appsignal-1.1.6 lib/appsignal/hooks/redis.rb
appsignal-1.1.6.beta.1 lib/appsignal/hooks/redis.rb
appsignal-1.1.5 lib/appsignal/hooks/redis.rb
appsignal-1.1.5.beta.4 lib/appsignal/hooks/redis.rb
appsignal-1.1.5.beta.3 lib/appsignal/hooks/redis.rb
appsignal-1.1.5.beta.2 lib/appsignal/hooks/redis.rb
appsignal-1.1.5.beta.1 lib/appsignal/hooks/redis.rb
appsignal-1.1.4 lib/appsignal/hooks/redis.rb
appsignal-1.1.4.beta.3 lib/appsignal/hooks/redis.rb
appsignal-1.1.4.beta.2 lib/appsignal/hooks/redis.rb