Method: Moped::Database#command_with_oboe

Defined in:
lib/oboe/inst/moped.rb

#command_with_oboe(command) ⇒ Object



55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/oboe/inst/moped.rb', line 55

def command_with_oboe(command)
  if Oboe.tracing? && !Oboe.layer_op && command.key?(:mapreduce)
    begin
      report_kvs = extract_trace_details(:map_reduce)
      report_kvs[:Map_Function] = command[:map]
      report_kvs[:Reduce_Function] = command[:reduce]
    rescue StandardError => e
      Oboe.logger.debug "[oboe/debug] Moped KV collection error: #{e.inspect}"
    end

    Oboe::API.trace('mongo', report_kvs) do
      command_without_oboe(command)
    end
  else
    command_without_oboe(command)
  end
end