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



37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/cacheflow/redis.rb', line 37

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