Module: Mnemosyne::Probes::Redis::Command::Probe::Instrumentation
- Defined in:
- lib/mnemosyne/probes/redis/command.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.instrument(commands, server_url) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/mnemosyne/probes/redis/command.rb', line 26 def instrument(commands, server_url) trace = ::Mnemosyne::Instrumenter.current_trace return yield unless trace span = ::Mnemosyne::Span.new 'db.query.redis', meta: (commands, server_url) span.start! begin yield.tap do |retval| span.[:error] = retval. if retval.is_a?(::Redis::CommandError) trace << span.finish! end rescue StandardError => e span.[:error] = e. trace << span.finish! raise end end |
Instance Method Details
#call(command, redis_config) ⇒ Object
17 18 19 |
# File 'lib/mnemosyne/probes/redis/command.rb', line 17 def call(command, redis_config) Instrumentation.instrument([command], client.server_url) { super } end |
#call_pipelined(commands, redis_config) ⇒ Object
21 22 23 |
# File 'lib/mnemosyne/probes/redis/command.rb', line 21 def call_pipelined(commands, redis_config) Instrumentation.instrument(commands, client.server_url) { super } end |