Sha256: 62ef02acdc72f48a28d181a9cf2e88257dd6c5306303d94f7769da7fb281bf7b
Contents?: true
Size: 956 Bytes
Versions: 88
Compression:
Stored size: 956 Bytes
Contents
module ScoutApm module Instruments class Redis attr_reader :logger def initalize(logger=ScoutApm::Agent.instance.logger) @logger = logger @installed = false end def installed? @installed end def install @installed = true if defined?(::Redis) && defined?(::Redis::Client) ScoutApm::Agent.instance.logger.info "Instrumenting Redis" ::Redis::Client.class_eval do include ScoutApm::Tracer def call_with_scout_instruments(*args, &block) command = args.first.first rescue "Unknown" self.class.instrument("Redis", command) do call_without_scout_instruments(*args, &block) end end alias_method :call_without_scout_instruments, :call alias_method :call, :call_with_scout_instruments end end end end end end
Version data entries
88 entries across 88 versions & 1 rubygems