Class: Moped::Collection
Constant Summary
Oboe::Inst::Moped::COLLECTION_OPS, Oboe::Inst::Moped::DB_OPS, Oboe::Inst::Moped::FLAVOR, Oboe::Inst::Moped::INDEX_OPS, Oboe::Inst::Moped::QUERY_OPS
Instance Method Summary
collapse
Instance Method Details
#aggregate_with_oboe(pipeline) ⇒ Object
464
465
466
467
468
469
470
471
472
473
474
|
# File 'lib/oboe/inst/moped.rb', line 464
def aggregate_with_oboe(pipeline)
if Oboe.tracing?
report_kvs = (:aggregate)
Oboe::API.trace('mongo', report_kvs) do
aggregate_without_oboe(pipeline)
end
else
aggregate_without_oboe(pipeline)
end
end
|
#drop_with_oboe ⇒ Object
409
410
411
412
413
414
415
416
417
418
419
420
421
|
# File 'lib/oboe/inst/moped.rb', line 409
def drop_with_oboe
if Oboe.tracing?
report_kvs = (:drop_collection)
Oboe::API.trace('mongo', report_kvs) do
drop_without_oboe
end
else
drop_without_oboe
end
end
|
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
|
# File 'lib/oboe/inst/moped.rb', line 393
def (op)
report_kvs = {}
begin
report_kvs[:Flavor] = Oboe::Inst::Moped::FLAVOR
report_kvs[:RemoteHost], report_kvs[:RemotePort] = @database.session.cluster.seeds.first.split(':')
report_kvs[:Database] = @database.name
report_kvs[:Collection] = @name
report_kvs[:QueryOp] = op.to_s
report_kvs[:Backtrace] = Oboe::API.backtrace if Oboe::Config[:moped][:collect_backtraces]
rescue Exception => e
Oboe.logger.debug "[oboe/debug] Moped KV collection error: #{e.inspect}"
end
report_kvs
end
|
#find_with_oboe(selector = {}) ⇒ Object
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
|
# File 'lib/oboe/inst/moped.rb', line 423
def find_with_oboe(selector = {})
if Oboe.tracing?
begin
report_kvs = (:find)
report_kvs[:Query] = selector.empty? ? "all" : selector.to_json
rescue Exception => e
Oboe.logger.debug "[oboe/debug] Moped KV collection error: #{e.inspect}"
end
Oboe::API.trace('mongo', report_kvs) do
find_without_oboe(selector)
end
else
find_without_oboe(selector)
end
end
|
#indexes_with_oboe ⇒ Object
440
441
442
443
444
445
446
447
448
449
450
|
# File 'lib/oboe/inst/moped.rb', line 440
def indexes_with_oboe
if Oboe.tracing?
report_kvs = (:indexes)
Oboe::API.trace('mongo', report_kvs) do
indexes_without_oboe
end
else
indexes_without_oboe
end
end
|
#insert_with_oboe(documents, flags = nil) ⇒ Object
452
453
454
455
456
457
458
459
460
461
462
|
# File 'lib/oboe/inst/moped.rb', line 452
def insert_with_oboe(documents, flags = nil)
if Oboe.tracing? and not Oboe::Context.tracing_layer_op?(:create_index)
report_kvs = (:insert)
Oboe::API.trace('mongo', report_kvs) do
insert_without_oboe(documents, flags)
end
else
insert_without_oboe(documents, flags)
end
end
|