lib/skylight/probes/redis.rb in skylight-5.1.0.beta vs lib/skylight/probes/redis.rb in skylight-5.1.0.beta2
- old
+ new
@@ -2,33 +2,21 @@
module Probes
module Redis
# Unfortunately, because of the nature of pipelining, there's no way for us to
# give a time breakdown on the individual items.
- PIPELINED_OPTS = {
- category: "db.redis.pipelined".freeze,
- title: "PIPELINE".freeze,
- internal: true
- }.freeze
+ PIPELINED_OPTS = { category: "db.redis.pipelined".freeze, title: "PIPELINE".freeze, internal: true }.freeze
- MULTI_OPTS = {
- category: "db.redis.multi".freeze,
- title: "MULTI".freeze,
- internal: true
- }.freeze
+ MULTI_OPTS = { category: "db.redis.multi".freeze, title: "MULTI".freeze, internal: true }.freeze
module ClientInstrumentation
def call(command, *)
command_name = command[0]
return super if command_name == :auth
- opts = {
- category: "db.redis.command",
- title: command_name.upcase.to_s,
- internal: true
- }
+ opts = { category: "db.redis.command", title: command_name.upcase.to_s, internal: true }
Skylight.instrument(opts) { super }
end
end
@@ -46,10 +34,10 @@
def install
version = defined?(::Redis::VERSION) ? Gem::Version.new(::Redis::VERSION) : nil
if !version || version < Gem::Version.new("3.0.0")
Skylight.error "The installed version of Redis doesn't support Middlewares. " \
- "At least version 3.0.0 is required."
+ "At least version 3.0.0 is required."
return
end
::Redis::Client.prepend(ClientInstrumentation)
::Redis.prepend(Instrumentation)