Sha256: 99fb81757b0c1dbbef4151bd79aab73646dfc4f10c37fd0605306998a96ab14e

Contents?: true

Size: 870 Bytes

Versions: 80

Compression:

Stored size: 870 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) &&
          Gem::Version.new(::RedisClient::VERSION) >= Gem::Version.new("0.14.0") &&
          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

80 entries across 80 versions & 1 rubygems

Version Path
appsignal-3.9.2-java lib/appsignal/hooks/redis_client.rb
appsignal-3.9.2 lib/appsignal/hooks/redis_client.rb
appsignal-3.9.1-java lib/appsignal/hooks/redis_client.rb
appsignal-3.9.1 lib/appsignal/hooks/redis_client.rb
appsignal-3.9.0-java lib/appsignal/hooks/redis_client.rb
appsignal-3.9.0 lib/appsignal/hooks/redis_client.rb
appsignal-3.8.1-java lib/appsignal/hooks/redis_client.rb
appsignal-3.8.1 lib/appsignal/hooks/redis_client.rb
appsignal-3.8.0-java lib/appsignal/hooks/redis_client.rb
appsignal-3.8.0 lib/appsignal/hooks/redis_client.rb
appsignal-3.7.6-java lib/appsignal/hooks/redis_client.rb
appsignal-3.7.6 lib/appsignal/hooks/redis_client.rb
appsignal-3.7.2-java lib/appsignal/hooks/redis_client.rb
appsignal-3.7.2 lib/appsignal/hooks/redis_client.rb
appsignal-3.7.1-java lib/appsignal/hooks/redis_client.rb
appsignal-3.7.1 lib/appsignal/hooks/redis_client.rb
appsignal-3.7.0-java lib/appsignal/hooks/redis_client.rb
appsignal-3.7.0 lib/appsignal/hooks/redis_client.rb
appsignal-3.6.5-java lib/appsignal/hooks/redis_client.rb
appsignal-3.6.5 lib/appsignal/hooks/redis_client.rb