Sha256: 8a8f10d0c59e420905d7148f0eb20e0bfc71c8b200d09e52e95c6ba17defd8fa

Contents?: true

Size: 786 Bytes

Versions: 14

Compression:

Stored size: 786 Bytes

Contents

# frozen_string_literal: true

module Appsignal
  class Hooks
    # @api private
    class RedisClientHook < Appsignal::Hooks::Hook
      register :redis_client

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

      def install
        require "appsignal/integrations/redis_client"
        ::RedisClient::RubyConnection.prepend Appsignal::Integrations::RedisClientIntegration
        Appsignal::Environment.report_enabled("redis")

        return unless defined?(::RedisClient::HiredisConnection)

        ::RedisClient::HiredisConnection.prepend Appsignal::Integrations::RedisClientIntegration
        Appsignal::Environment.report_enabled("hiredis")
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
appsignal-3.6.4-java lib/appsignal/hooks/redis_client.rb
appsignal-3.6.4 lib/appsignal/hooks/redis_client.rb
appsignal-3.6.3-java lib/appsignal/hooks/redis_client.rb
appsignal-3.6.3 lib/appsignal/hooks/redis_client.rb
appsignal-3.6.2-java lib/appsignal/hooks/redis_client.rb
appsignal-3.6.2 lib/appsignal/hooks/redis_client.rb
appsignal-3.6.1-java lib/appsignal/hooks/redis_client.rb
appsignal-3.6.1 lib/appsignal/hooks/redis_client.rb
appsignal-3.6.0-java lib/appsignal/hooks/redis_client.rb
appsignal-3.6.0 lib/appsignal/hooks/redis_client.rb
appsignal-3.5.6-java lib/appsignal/hooks/redis_client.rb
appsignal-3.5.6 lib/appsignal/hooks/redis_client.rb
appsignal-3.5.5-java lib/appsignal/hooks/redis_client.rb
appsignal-3.5.5 lib/appsignal/hooks/redis_client.rb