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.2.5 lib/appsignal/hooks/redis.rb
appsignal-1.2.4 lib/appsignal/hooks/redis.rb
appsignal-1.2.4.beta.4 lib/appsignal/hooks/redis.rb
appsignal-1.2.4.beta.3 lib/appsignal/hooks/redis.rb
appsignal-1.2.4.beta.2 lib/appsignal/hooks/redis.rb
appsignal-1.2.4.beta.1 lib/appsignal/hooks/redis.rb
appsignal-1.2.3 lib/appsignal/hooks/redis.rb
appsignal-1.2.3.beta.3 lib/appsignal/hooks/redis.rb
appsignal-1.2.3.beta.2 lib/appsignal/hooks/redis.rb
appsignal-1.2.3.beta.1 lib/appsignal/hooks/redis.rb
appsignal-1.2.2 lib/appsignal/hooks/redis.rb
appsignal-1.2.1 lib/appsignal/hooks/redis.rb
appsignal-1.2.1.beta.3 lib/appsignal/hooks/redis.rb
appsignal-1.2.1.beta.2 lib/appsignal/hooks/redis.rb
appsignal-1.2.1.beta.1 lib/appsignal/hooks/redis.rb
appsignal-1.2.0 lib/appsignal/hooks/redis.rb
appsignal-1.2.0.beta.1 lib/appsignal/hooks/redis.rb
appsignal-1.2.0.alpha.6 lib/appsignal/hooks/redis.rb
appsignal-1.2.0.alpha.5 lib/appsignal/hooks/redis.rb
appsignal-1.2.0.alpha.4 lib/appsignal/hooks/redis.rb