Class: Moped::Database
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
#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 = (: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
|
#drop_with_oboe ⇒ Object
73
74
75
76
77
78
79
80
81
|
# File 'lib/oboe/inst/moped.rb', line 73
def drop_with_oboe
return drop_without_oboe unless Oboe.tracing?
report_kvs = (:drop_database)
Oboe::API.trace('mongo', report_kvs) do
drop_without_oboe
end
end
|
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
# File 'lib/oboe/inst/moped.rb', line 35
def (op)
report_kvs = {}
begin
report_kvs[:Flavor] = Oboe::Inst::Moped::FLAVOR
if ::Moped::VERSION < '2.0.0'
report_kvs[:RemoteHost], report_kvs[:RemotePort] = session.cluster.seeds.first.split(':')
else
report_kvs[:RemoteHost] = session.cluster.seeds.first.address.host
report_kvs[:RemotePort] = session.cluster.seeds.first.address.port
end
report_kvs[:Database] = name
report_kvs[:QueryOp] = op.to_s
report_kvs[:Backtrace] = Oboe::API.backtrace if Oboe::Config[:moped][:collect_backtraces]
rescue StandardError => e
Oboe.logger.debug "[oboe/debug] Moped KV collection error: #{e.inspect}"
end
report_kvs
end
|