Method: Moped::Query#count_with_oboe

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

#count_with_oboeObject



191
192
193
194
195
196
197
198
199
200
201
202
203
204
# File 'lib/oboe/inst/moped.rb', line 191

def count_with_oboe
  return count_without_oboe unless Oboe.tracing?

  begin
    report_kvs = extract_trace_details(:count)
    report_kvs[:Query] = selector.empty? ? 'all' : selector.to_json
  rescue StandardError => e
    Oboe.logger.debug "[oboe/debug] Moped KV collection error: #{e.inspect}"
  end

  Oboe::API.trace('mongo', report_kvs) do
    count_without_oboe
  end
end