Class: Skylight::Probes::Redis::Probe Private

Inherits:
Object
  • Object
show all
Defined in:
lib/skylight/probes/redis.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

#installObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/skylight/probes/redis.rb', line 5

def install
  ::Redis::Client.class_eval do
    alias call_without_sk call

    def call(command, &block)
      command_name = command[0]

      return call_without_sk(command, &block) if command_name == :auth

      opts = {
        category: "db.redis.command",
        title:    command_name.upcase.to_s
      }

      Skylight.instrument(opts) do
        call_without_sk(command, &block)
      end
    end
  end
end