Module: RailsObservatory::LoggingMiddleware

Defined in:
lib/rails_observatory/redis/logging_middleware.rb

Instance Method Summary collapse

Instance Method Details

#call(command, redis_config) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/rails_observatory/redis/logging_middleware.rb', line 8

def call(command, redis_config)
  if command.first == "SCRIPT"
    puts "[Redis] #{command.first}"
  else
    puts "[Redis] #{command.first} #{command[1..-1].join(" ")}"
  end
  super
end

#call_pipelined(commands, redis_config) ⇒ Object



17
18
19
20
# File 'lib/rails_observatory/redis/logging_middleware.rb', line 17

def call_pipelined(commands, redis_config)
  puts "[Redis] [Pipelined] #{commands.join("\n")}"
  super
end

#connect(redis_config) ⇒ Object



3
4
5
6
# File 'lib/rails_observatory/redis/logging_middleware.rb', line 3

def connect(redis_config)
  puts "[Redis] CONNECT"
  super
end