Class: Cacheflow::Redis::Instrumenter

Inherits:
ActiveSupport::LogSubscriber
  • Object
show all
Defined in:
lib/cacheflow/redis.rb

Instance Method Summary collapse

Instance Method Details

#query(event) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/cacheflow/redis.rb', line 24

def query(event)
  return if !logger.debug? || Cacheflow.silenced?

  name = "%s (%.2fms)" % ["Redis", event.duration]

  commands = []
  event.payload[:commands].map do |op, *args|
    commands << "#{op.to_s.upcase} #{Cacheflow.args(args)}".strip
  end

  debug "  #{color(name, RED, bold: true)} #{commands.join(" >> ")}"
end