oboe 2.6.8 → 2.7.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +11 -0
- data/CHANGELOG.md +19 -0
- data/Gemfile +15 -7
- data/README.md +7 -20
- data/Rakefile +58 -43
- data/ext/oboe_metal/extconf.rb +1 -6
- data/lib/base.rb +9 -17
- data/lib/joboe_metal.rb +102 -22
- data/lib/oboe.rb +2 -2
- data/lib/oboe/api/logging.rb +3 -3
- data/lib/oboe/api/tracing.rb +2 -2
- data/lib/oboe/frameworks/padrino/templates.rb +1 -1
- data/lib/oboe/frameworks/sinatra/templates.rb +1 -1
- data/lib/oboe/inst/cassandra.rb +3 -3
- data/lib/oboe/inst/dalli.rb +1 -1
- data/lib/oboe/inst/memcache.rb +1 -1
- data/lib/oboe/inst/moped.rb +30 -10
- data/lib/oboe/inst/resque.rb +1 -1
- data/lib/oboe/version.rb +3 -3
- data/lib/oboe_metal.rb +35 -0
- data/oboe.gemspec +4 -3
- data/test/frameworks/apps/grape_simple.rb +0 -2
- data/test/instrumentation/cassandra_test.rb +297 -293
- data/test/instrumentation/dalli_test.rb +1 -1
- data/test/instrumentation/memcached_test.rb +1 -1
- data/test/instrumentation/moped_test.rb +1 -1
- data/test/instrumentation/rack_test.rb +9 -0
- data/test/minitest_helper.rb +9 -19
- data/test/support/liboboe_settings_test.rb +33 -28
- metadata +4 -4
- data/Gemfile.lock +0 -114
data/lib/oboe.rb
CHANGED
@@ -12,11 +12,11 @@ begin
|
|
12
12
|
unless defined?(Oboe_metal)
|
13
13
|
begin
|
14
14
|
if RUBY_PLATFORM == 'java'
|
15
|
-
require 'joboe_metal'
|
16
15
|
require '/usr/local/tracelytics/tracelyticsagent.jar'
|
16
|
+
require 'joboe_metal'
|
17
17
|
else
|
18
|
-
require 'oboe_metal'
|
19
18
|
require 'oboe_metal.so'
|
19
|
+
require 'oboe_metal'
|
20
20
|
end
|
21
21
|
rescue LoadError
|
22
22
|
Oboe.loaded = false
|
data/lib/oboe/api/logging.rb
CHANGED
@@ -62,7 +62,7 @@ module Oboe
|
|
62
62
|
def log_start(layer, xtrace, opts={})
|
63
63
|
return if Oboe.never? or (opts.has_key?(:URL) and ::Oboe::Util.static_asset?(opts[:URL]))
|
64
64
|
|
65
|
-
if xtrace
|
65
|
+
if xtrace and not xtrace.to_s.empty?
|
66
66
|
Oboe::Context.fromString(xtrace)
|
67
67
|
end
|
68
68
|
|
@@ -86,12 +86,12 @@ module Oboe
|
|
86
86
|
end
|
87
87
|
|
88
88
|
def log_entry(layer, opts={}, protect_op=nil)
|
89
|
-
Oboe
|
89
|
+
Oboe.layer_op = protect_op if protect_op
|
90
90
|
log_event(layer, 'entry', Oboe::Context.createEvent, opts)
|
91
91
|
end
|
92
92
|
|
93
93
|
def log_exit(layer, opts={}, protect_op=nil)
|
94
|
-
Oboe
|
94
|
+
Oboe.layer_op = nil if protect_op
|
95
95
|
log_event(layer, 'exit', Oboe::Context.createEvent, opts)
|
96
96
|
end
|
97
97
|
|
data/lib/oboe/api/tracing.rb
CHANGED
@@ -11,7 +11,7 @@ module Oboe
|
|
11
11
|
# layer - The layer the block of code belongs to.
|
12
12
|
# opts - A hash containing key/value pairs that will be reported along
|
13
13
|
# with the first event of this layer (optional).
|
14
|
-
# protect_op - specify the
|
14
|
+
# protect_op - specify the operation being traced. Used to avoid
|
15
15
|
# double tracing between operations that call each other
|
16
16
|
#
|
17
17
|
# Example
|
@@ -73,7 +73,7 @@ module Oboe
|
|
73
73
|
# Returns a list of length two, the first element of which is the result
|
74
74
|
# of the block, and the second element of which is the oboe context that
|
75
75
|
# was set when the block completed execution.
|
76
|
-
def start_trace(layer, xtrace, opts={})
|
76
|
+
def start_trace(layer, xtrace=nil, opts={})
|
77
77
|
log_start(layer, xtrace, opts)
|
78
78
|
begin
|
79
79
|
result = yield
|
@@ -15,7 +15,7 @@ module Oboe
|
|
15
15
|
report_kvs[:engine] = engine
|
16
16
|
report_kvs[:template] = data
|
17
17
|
|
18
|
-
if Oboe
|
18
|
+
if Oboe.tracing_layer_op?('render')
|
19
19
|
# For recursive calls to :render (for sub-partials and layouts),
|
20
20
|
# use method profiling.
|
21
21
|
begin
|
data/lib/oboe/inst/cassandra.rb
CHANGED
@@ -77,7 +77,7 @@ module Oboe
|
|
77
77
|
def get_columns_with_oboe(column_family, key, *columns_and_options)
|
78
78
|
args = [column_family, key] + columns_and_options
|
79
79
|
|
80
|
-
if Oboe.tracing? and not Oboe
|
80
|
+
if Oboe.tracing? and not Oboe.tracing_layer_op?(:multi_get_columns)
|
81
81
|
report_kvs = extract_trace_details(:get_columns, column_family, key, columns_and_options)
|
82
82
|
|
83
83
|
Oboe::API.trace('cassandra', report_kvs) do
|
@@ -113,7 +113,7 @@ module Oboe
|
|
113
113
|
def multi_get_with_oboe(column_family, key, *columns_and_options)
|
114
114
|
args = [column_family, key] + columns_and_options
|
115
115
|
|
116
|
-
if Oboe.tracing? and not Oboe
|
116
|
+
if Oboe.tracing? and not Oboe.tracing_layer_op?(:get)
|
117
117
|
report_kvs = extract_trace_details(:multi_get, column_family, key, columns_and_options)
|
118
118
|
|
119
119
|
Oboe::API.trace('cassandra', report_kvs) do
|
@@ -136,7 +136,7 @@ module Oboe
|
|
136
136
|
end
|
137
137
|
|
138
138
|
def get_range_single_with_oboe(column_family, options = {})
|
139
|
-
if Oboe.tracing? and not Oboe
|
139
|
+
if Oboe.tracing? and not Oboe.tracing_layer_op?(:get_range_batch)
|
140
140
|
report_kvs = extract_trace_details(:get_range_single, column_family, nil, nil)
|
141
141
|
args = [column_family, options]
|
142
142
|
|
data/lib/oboe/inst/dalli.rb
CHANGED
@@ -25,7 +25,7 @@ module Oboe
|
|
25
25
|
def perform_with_oboe(*all_args, &blk)
|
26
26
|
op, key, *args = *all_args
|
27
27
|
|
28
|
-
if Oboe.tracing? and not Oboe
|
28
|
+
if Oboe.tracing? and not Oboe.tracing_layer_op?(:get_multi)
|
29
29
|
Oboe::API.trace('memcache', { :KVOp => op, :KVKey => key }) do
|
30
30
|
result = perform_without_oboe(*all_args, &blk)
|
31
31
|
|
data/lib/oboe/inst/memcache.rb
CHANGED
@@ -70,7 +70,7 @@ module Oboe
|
|
70
70
|
end
|
71
71
|
|
72
72
|
def request_setup_with_oboe(*args)
|
73
|
-
if Oboe.tracing? and not Oboe
|
73
|
+
if Oboe.tracing? and not Oboe.tracing_layer_op?(:get_multi)
|
74
74
|
server, cache_key = request_setup_without_oboe(*args)
|
75
75
|
|
76
76
|
info_kvs = { :KVKey => cache_key, :RemoteHost => server.host }
|
data/lib/oboe/inst/moped.rb
CHANGED
@@ -37,7 +37,12 @@ if defined?(::Moped) and Oboe::Config[:moped][:enabled]
|
|
37
37
|
begin
|
38
38
|
report_kvs[:Flavor] = Oboe::Inst::Moped::FLAVOR
|
39
39
|
# FIXME: We're only grabbing the first of potentially multiple servers here
|
40
|
-
|
40
|
+
if ::Moped::VERSION < "2.0.0"
|
41
|
+
report_kvs[:RemoteHost], report_kvs[:RemotePort] = session.cluster.seeds.first.split(':')
|
42
|
+
else
|
43
|
+
report_kvs[:RemoteHost] = session.cluster.seeds.first.address.host
|
44
|
+
report_kvs[:RemotePort] = session.cluster.seeds.first.address.port
|
45
|
+
end
|
41
46
|
report_kvs[:Database] = name
|
42
47
|
report_kvs[:QueryOp] = op.to_s
|
43
48
|
report_kvs[:Backtrace] = Oboe::API.backtrace if Oboe::Config[:moped][:collect_backtraces]
|
@@ -48,7 +53,7 @@ if defined?(::Moped) and Oboe::Config[:moped][:enabled]
|
|
48
53
|
end
|
49
54
|
|
50
55
|
def command_with_oboe(command)
|
51
|
-
if Oboe.tracing? and not Oboe
|
56
|
+
if Oboe.tracing? and not Oboe.layer_op and command.has_key?(:mapreduce)
|
52
57
|
begin
|
53
58
|
report_kvs = extract_trace_details(:map_reduce)
|
54
59
|
report_kvs[:Map_Function] = command[:map]
|
@@ -96,7 +101,12 @@ if defined?(::Moped) and Oboe::Config[:moped][:enabled]
|
|
96
101
|
begin
|
97
102
|
report_kvs[:Flavor] = Oboe::Inst::Moped::FLAVOR
|
98
103
|
# FIXME: We're only grabbing the first of potentially multiple servers here
|
99
|
-
|
104
|
+
if ::Moped::VERSION < "2.0.0"
|
105
|
+
report_kvs[:RemoteHost], report_kvs[:RemotePort] = database.session.cluster.seeds.first.split(':')
|
106
|
+
else
|
107
|
+
report_kvs[:RemoteHost] = database.session.cluster.seeds.first.address.host
|
108
|
+
report_kvs[:RemotePort] = database.session.cluster.seeds.first.address.port
|
109
|
+
end
|
100
110
|
report_kvs[:Database] = database.name
|
101
111
|
report_kvs[:QueryOp] = op.to_s
|
102
112
|
report_kvs[:Backtrace] = Oboe::API.backtrace if Oboe::Config[:moped][:collect_backtraces]
|
@@ -162,7 +172,12 @@ if defined?(::Moped) and Oboe::Config[:moped][:enabled]
|
|
162
172
|
begin
|
163
173
|
report_kvs[:Flavor] = Oboe::Inst::Moped::FLAVOR
|
164
174
|
# FIXME: We're only grabbing the first of potentially multiple servers here
|
165
|
-
|
175
|
+
if ::Moped::VERSION < "2.0.0"
|
176
|
+
report_kvs[:RemoteHost], report_kvs[:RemotePort] = collection.database.session.cluster.seeds.first.split(':')
|
177
|
+
else
|
178
|
+
report_kvs[:RemoteHost] = collection.database.session.cluster.seeds.first.address.host
|
179
|
+
report_kvs[:RemotePort] = collection.database.session.cluster.seeds.first.address.port
|
180
|
+
end
|
166
181
|
report_kvs[:Database] = collection.database.name
|
167
182
|
report_kvs[:Collection] = collection.name
|
168
183
|
report_kvs[:QueryOp] = op.to_s
|
@@ -205,7 +220,7 @@ if defined?(::Moped) and Oboe::Config[:moped][:enabled]
|
|
205
220
|
end
|
206
221
|
|
207
222
|
def limit_with_oboe(limit)
|
208
|
-
if Oboe.tracing? and not Oboe
|
223
|
+
if Oboe.tracing? and not Oboe.tracing_layer_op?(:explain)
|
209
224
|
begin
|
210
225
|
report_kvs = extract_trace_details(:limit)
|
211
226
|
report_kvs[:Query] = selector.empty? ? "all" : selector.to_json
|
@@ -239,7 +254,7 @@ if defined?(::Moped) and Oboe::Config[:moped][:enabled]
|
|
239
254
|
end
|
240
255
|
|
241
256
|
def update_with_oboe(change, flags = nil)
|
242
|
-
if Oboe.tracing? and not Oboe
|
257
|
+
if Oboe.tracing? and not Oboe.tracing_layer_op?([:update_all, :upsert])
|
243
258
|
begin
|
244
259
|
report_kvs = extract_trace_details(:update)
|
245
260
|
report_kvs[:Flags] = flags.to_s if flags
|
@@ -371,9 +386,14 @@ if defined?(::Moped) and Oboe::Config[:moped][:enabled]
|
|
371
386
|
begin
|
372
387
|
report_kvs[:Flavor] = Oboe::Inst::Moped::FLAVOR
|
373
388
|
# FIXME: We're only grabbing the first of potentially multiple servers here
|
374
|
-
|
375
|
-
|
376
|
-
|
389
|
+
if ::Moped::VERSION < "2.0.0"
|
390
|
+
report_kvs[:RemoteHost], report_kvs[:RemotePort] = database.session.cluster.seeds.first.split(':')
|
391
|
+
else
|
392
|
+
report_kvs[:RemoteHost] = database.session.cluster.seeds.first.address.host
|
393
|
+
report_kvs[:RemotePort] = database.session.cluster.seeds.first.address.port
|
394
|
+
end
|
395
|
+
report_kvs[:Database] = database.name
|
396
|
+
report_kvs[:Collection] = name
|
377
397
|
report_kvs[:QueryOp] = op.to_s
|
378
398
|
report_kvs[:Backtrace] = Oboe::API.backtrace if Oboe::Config[:moped][:collect_backtraces]
|
379
399
|
rescue StandardError => e
|
@@ -420,7 +440,7 @@ if defined?(::Moped) and Oboe::Config[:moped][:enabled]
|
|
420
440
|
end
|
421
441
|
|
422
442
|
def insert_with_oboe(documents, flags = nil)
|
423
|
-
if Oboe.tracing? and not Oboe
|
443
|
+
if Oboe.tracing? and not Oboe.tracing_layer_op?(:create_index)
|
424
444
|
report_kvs = extract_trace_details(:insert)
|
425
445
|
|
426
446
|
Oboe::API.trace('mongo', report_kvs) do
|
data/lib/oboe/inst/resque.rb
CHANGED
@@ -51,7 +51,7 @@ module Oboe
|
|
51
51
|
end
|
52
52
|
|
53
53
|
def enqueue_to_with_oboe(queue, klass, *args)
|
54
|
-
if Oboe.tracing? and not Oboe
|
54
|
+
if Oboe.tracing? and not Oboe.tracing_layer_op?(:enqueue)
|
55
55
|
report_kvs = extract_trace_details(:enqueue_to, klass, args)
|
56
56
|
report_kvs[:Queue] = queue.to_s if queue
|
57
57
|
|
data/lib/oboe/version.rb
CHANGED
data/lib/oboe_metal.rb
CHANGED
@@ -38,6 +38,41 @@ module Oboe
|
|
38
38
|
def self.sendReport(evt)
|
39
39
|
Oboe.reporter.sendReport(evt)
|
40
40
|
end
|
41
|
+
|
42
|
+
##
|
43
|
+
# clear_all_traces
|
44
|
+
#
|
45
|
+
# Truncates the trace output file to zero
|
46
|
+
#
|
47
|
+
def self.clear_all_traces
|
48
|
+
File.truncate($trace_file, 0)
|
49
|
+
end
|
50
|
+
|
51
|
+
##
|
52
|
+
# get_all_traces
|
53
|
+
#
|
54
|
+
# Retrieves all traces written to the trace file
|
55
|
+
#
|
56
|
+
def self.get_all_traces
|
57
|
+
io = File.open($trace_file, "r")
|
58
|
+
contents = io.readlines(nil)
|
59
|
+
|
60
|
+
return contents if contents.empty?
|
61
|
+
|
62
|
+
s = StringIO.new(contents[0])
|
63
|
+
|
64
|
+
traces = []
|
65
|
+
|
66
|
+
until s.eof?
|
67
|
+
if ::BSON.respond_to? :read_bson_document
|
68
|
+
traces << BSON.read_bson_document(s)
|
69
|
+
else
|
70
|
+
traces << BSON::Document.from_bson(s)
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
traces
|
75
|
+
end
|
41
76
|
end
|
42
77
|
|
43
78
|
class Event
|
data/oboe.gemspec
CHANGED
@@ -12,13 +12,14 @@ Gem::Specification.new do |s|
|
|
12
12
|
s.email = %q{traceviewsupport@appneta.com}
|
13
13
|
s.homepage = %q{http://www.appneta.com/products/traceview/}
|
14
14
|
s.summary = %q{AppNeta TraceView performance instrumentation gem for Ruby}
|
15
|
-
s.description = %q{The oboe gem provides TraceView instrumentation for Ruby and
|
15
|
+
s.description = %q{The oboe gem provides TraceView instrumentation for MRI Ruby, JRuby and related frameworks.}
|
16
16
|
|
17
17
|
s.extra_rdoc_files = ["LICENSE"]
|
18
18
|
s.files = `git ls-files`.split("\n")
|
19
19
|
s.test_files = Dir.glob("{test}/**/*.rb")
|
20
|
-
|
21
|
-
s.
|
20
|
+
|
21
|
+
s.platform = defined?(JRUBY_VERSION) ? 'java' : Gem::Platform::RUBY
|
22
|
+
s.extensions = ['ext/oboe_metal/extconf.rb'] unless defined?(JRUBY_VERSION)
|
22
23
|
|
23
24
|
s.add_runtime_dependency('json', '>= 0')
|
24
25
|
s.add_development_dependency('rake', '>= 0')
|
@@ -1,377 +1,381 @@
|
|
1
1
|
require 'minitest_helper'
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
3
|
+
# The cassandra-rb client doesn't support JRuby
|
4
|
+
# https://github.com/cassandra-rb/cassandra
|
5
|
+
unless defined?(JRUBY_VERSION)
|
6
|
+
describe Oboe::Inst::Cassandra do
|
7
|
+
before do
|
8
|
+
clear_all_traces
|
9
|
+
|
10
|
+
@client = Cassandra.new("system", "127.0.0.1:9160", { :timeout => 10 })
|
11
|
+
@client.disable_node_auto_discovery!
|
12
|
+
|
13
|
+
@ks_name = "AppNetaCassandraTest"
|
14
|
+
|
15
|
+
ks_def = CassandraThrift::KsDef.new(:name => @ks_name,
|
16
|
+
:strategy_class => "SimpleStrategy",
|
17
|
+
:strategy_options => { 'replication_factor' => '2' },
|
18
|
+
:cf_defs => [])
|
19
|
+
|
20
|
+
@client.add_keyspace(ks_def) unless @client.keyspaces.include? @ks_name
|
21
|
+
@client.keyspace = @ks_name
|
22
|
+
|
23
|
+
unless @client.column_families.include? "Users"
|
24
|
+
cf_def = CassandraThrift::CfDef.new(:keyspace => @ks_name, :name => "Users")
|
25
|
+
@client.add_column_family(cf_def)
|
26
|
+
end
|
27
|
+
|
28
|
+
unless @client.column_families.include? "Statuses"
|
29
|
+
cf_def = CassandraThrift::CfDef.new(:keyspace => @ks_name, :name => "Statuses")
|
30
|
+
@client.add_column_family(cf_def)
|
31
|
+
end
|
32
|
+
|
33
|
+
# These are standard entry/exit KVs that are passed up with all mongo operations
|
34
|
+
@entry_kvs = {
|
35
|
+
'Layer' => 'cassandra',
|
36
|
+
'Label' => 'entry',
|
37
|
+
'RemoteHost' => '127.0.0.1',
|
38
|
+
'RemotePort' => '9160' }
|
39
|
+
|
40
|
+
@exit_kvs = { 'Layer' => 'cassandra', 'Label' => 'exit' }
|
41
|
+
@collect_backtraces = Oboe::Config[:cassandra][:collect_backtraces]
|
23
42
|
end
|
24
43
|
|
25
|
-
|
26
|
-
|
27
|
-
@client.
|
44
|
+
after do
|
45
|
+
Oboe::Config[:cassandra][:collect_backtraces] = @collect_backtraces
|
46
|
+
@client.disconnect!
|
28
47
|
end
|
29
48
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
'Label' => 'entry',
|
34
|
-
'RemoteHost' => '127.0.0.1',
|
35
|
-
'RemotePort' => '9160' }
|
36
|
-
|
37
|
-
@exit_kvs = { 'Layer' => 'cassandra', 'Label' => 'exit' }
|
38
|
-
@collect_backtraces = Oboe::Config[:cassandra][:collect_backtraces]
|
39
|
-
end
|
40
|
-
|
41
|
-
after do
|
42
|
-
Oboe::Config[:cassandra][:collect_backtraces] = @collect_backtraces
|
43
|
-
@client.disconnect!
|
44
|
-
end
|
45
|
-
|
46
|
-
it 'Stock Cassandra should be loaded, defined and ready' do
|
47
|
-
defined?(::Cassandra).wont_match nil
|
48
|
-
end
|
49
|
+
it 'Stock Cassandra should be loaded, defined and ready' do
|
50
|
+
defined?(::Cassandra).wont_match nil
|
51
|
+
end
|
49
52
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
53
|
+
it 'Cassandra should have oboe methods defined' do
|
54
|
+
[ :insert, :remove, :count_columns, :get_columns, :multi_get_columns, :get,
|
55
|
+
:multi_get, :get_range_single, :get_range_batch, :get_indexed_slices,
|
56
|
+
:create_index, :drop_index, :add_column_family, :drop_column_family,
|
57
|
+
:add_keyspace, :drop_keyspace ].each do |m|
|
58
|
+
::Cassandra.method_defined?("#{m}_with_oboe").must_equal true
|
59
|
+
end
|
60
|
+
# Special 'exists?' case
|
61
|
+
::Cassandra.method_defined?("exists_with_oboe?").must_equal true
|
56
62
|
end
|
57
|
-
# Special 'exists?' case
|
58
|
-
::Cassandra.method_defined?("exists_with_oboe?").must_equal true
|
59
|
-
end
|
60
63
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
64
|
+
it 'should trace insert' do
|
65
|
+
Oboe::API.start_trace('cassandra_test', '', {}) do
|
66
|
+
user = {'screen_name' => 'larry', "blah" => "ok"}
|
67
|
+
@client.insert(:Users, '5', user, { :ttl => 600, :consistency => 1})
|
68
|
+
end
|
69
|
+
|
70
|
+
traces = get_all_traces
|
71
|
+
|
72
|
+
traces.count.must_equal 4
|
73
|
+
validate_outer_layers(traces, 'cassandra_test')
|
74
|
+
|
75
|
+
validate_event_keys(traces[1], @entry_kvs)
|
76
|
+
traces[1]['Op'].must_equal "insert"
|
77
|
+
traces[1]['Cf'].must_equal "Users"
|
78
|
+
traces[1]['Key'].must_equal "\"5\""
|
79
|
+
traces[1]['Consistency'].must_equal "1"
|
80
|
+
traces[1]['Ttl'].must_equal "600"
|
81
|
+
traces[1].has_key?('Backtrace').must_equal Oboe::Config[:cassandra][:collect_backtraces]
|
82
|
+
validate_event_keys(traces[2], @exit_kvs)
|
65
83
|
end
|
66
84
|
|
67
|
-
|
85
|
+
it 'should trace remove' do
|
86
|
+
Oboe::API.start_trace('cassandra_test', '', {}) do
|
87
|
+
@client.remove(:Users, '5', 'blah')
|
88
|
+
end
|
68
89
|
|
69
|
-
|
70
|
-
validate_outer_layers(traces, 'cassandra_test')
|
90
|
+
traces = get_all_traces
|
71
91
|
|
72
|
-
|
73
|
-
|
74
|
-
traces[1]['Cf'].must_equal "Users"
|
75
|
-
traces[1]['Key'].must_equal "\"5\""
|
76
|
-
traces[1]['Consistency'].must_equal "1"
|
77
|
-
traces[1]['Ttl'].must_equal "600"
|
78
|
-
traces[1].has_key?('Backtrace').must_equal Oboe::Config[:cassandra][:collect_backtraces]
|
79
|
-
validate_event_keys(traces[2], @exit_kvs)
|
80
|
-
end
|
92
|
+
traces.count.must_equal 4
|
93
|
+
validate_outer_layers(traces, 'cassandra_test')
|
81
94
|
|
82
|
-
|
83
|
-
|
84
|
-
|
95
|
+
validate_event_keys(traces[1], @entry_kvs)
|
96
|
+
traces[1]['Op'].must_equal "remove"
|
97
|
+
traces[1]['Cf'].must_equal "Users"
|
98
|
+
traces[1]['Key'].must_equal "\"5\""
|
99
|
+
traces[1].has_key?('Backtrace').must_equal Oboe::Config[:cassandra][:collect_backtraces]
|
100
|
+
validate_event_keys(traces[2], @exit_kvs)
|
85
101
|
end
|
86
102
|
|
87
|
-
|
103
|
+
it 'should trace count_columns' do
|
104
|
+
@client.insert(:Statuses, '12', {'body' => 'v1', 'user' => 'v2'})
|
88
105
|
|
89
|
-
|
90
|
-
|
106
|
+
Oboe::API.start_trace('cassandra_test', '', {}) do
|
107
|
+
@client.count_columns(:Statuses, '12', :count => 50)
|
108
|
+
end
|
91
109
|
|
92
|
-
|
93
|
-
traces[1]['Op'].must_equal "remove"
|
94
|
-
traces[1]['Cf'].must_equal "Users"
|
95
|
-
traces[1]['Key'].must_equal "\"5\""
|
96
|
-
traces[1].has_key?('Backtrace').must_equal Oboe::Config[:cassandra][:collect_backtraces]
|
97
|
-
validate_event_keys(traces[2], @exit_kvs)
|
98
|
-
end
|
110
|
+
traces = get_all_traces
|
99
111
|
|
100
|
-
|
101
|
-
|
112
|
+
traces.count.must_equal 4
|
113
|
+
validate_outer_layers(traces, 'cassandra_test')
|
102
114
|
|
103
|
-
|
104
|
-
|
115
|
+
validate_event_keys(traces[1], @entry_kvs)
|
116
|
+
traces[1]['Op'].must_equal "count_columns"
|
117
|
+
traces[1]['Cf'].must_equal "Statuses"
|
118
|
+
traces[1]['Key'].must_equal "\"12\""
|
119
|
+
traces[1]['Count'].must_equal "50"
|
120
|
+
traces[1].has_key?('Backtrace').must_equal Oboe::Config[:cassandra][:collect_backtraces]
|
121
|
+
validate_event_keys(traces[2], @exit_kvs)
|
105
122
|
end
|
106
123
|
|
107
|
-
|
124
|
+
it 'should trace get_columns' do
|
125
|
+
Oboe::API.start_trace('cassandra_test', '', {}) do
|
126
|
+
@client.get_columns(:Statuses, '12', ['body'])
|
127
|
+
end
|
108
128
|
|
109
|
-
|
110
|
-
validate_outer_layers(traces, 'cassandra_test')
|
129
|
+
traces = get_all_traces
|
111
130
|
|
112
|
-
|
113
|
-
|
114
|
-
traces[1]['Cf'].must_equal "Statuses"
|
115
|
-
traces[1]['Key'].must_equal "\"12\""
|
116
|
-
traces[1]['Count'].must_equal "50"
|
117
|
-
traces[1].has_key?('Backtrace').must_equal Oboe::Config[:cassandra][:collect_backtraces]
|
118
|
-
validate_event_keys(traces[2], @exit_kvs)
|
119
|
-
end
|
131
|
+
traces.count.must_equal 4
|
132
|
+
validate_outer_layers(traces, 'cassandra_test')
|
120
133
|
|
121
|
-
|
122
|
-
|
123
|
-
|
134
|
+
validate_event_keys(traces[1], @entry_kvs)
|
135
|
+
traces[1]['Op'].must_equal "get_columns"
|
136
|
+
traces[1]['Cf'].must_equal "Statuses"
|
137
|
+
traces[1]['Key'].must_equal "\"12\""
|
138
|
+
traces[1].has_key?('Backtrace').must_equal Oboe::Config[:cassandra][:collect_backtraces]
|
139
|
+
validate_event_keys(traces[2], @exit_kvs)
|
124
140
|
end
|
125
141
|
|
126
|
-
|
142
|
+
it 'should trace multi_get_columns' do
|
143
|
+
Oboe::API.start_trace('cassandra_test', '', {}) do
|
144
|
+
@client.multi_get_columns(:Users, ['12', '5'], ['body'])
|
145
|
+
end
|
127
146
|
|
128
|
-
|
129
|
-
validate_outer_layers(traces, 'cassandra_test')
|
147
|
+
traces = get_all_traces
|
130
148
|
|
131
|
-
|
132
|
-
|
133
|
-
traces[1]['Cf'].must_equal "Statuses"
|
134
|
-
traces[1]['Key'].must_equal "\"12\""
|
135
|
-
traces[1].has_key?('Backtrace').must_equal Oboe::Config[:cassandra][:collect_backtraces]
|
136
|
-
validate_event_keys(traces[2], @exit_kvs)
|
137
|
-
end
|
149
|
+
traces.count.must_equal 4
|
150
|
+
validate_outer_layers(traces, 'cassandra_test')
|
138
151
|
|
139
|
-
|
140
|
-
|
141
|
-
|
152
|
+
validate_event_keys(traces[1], @entry_kvs)
|
153
|
+
traces[1]['Op'].must_equal "multi_get_columns"
|
154
|
+
traces[1]['Cf'].must_equal "Users"
|
155
|
+
traces[1]['Key'].must_equal "[\"12\", \"5\"]"
|
156
|
+
traces[1].has_key?('Backtrace').must_equal Oboe::Config[:cassandra][:collect_backtraces]
|
157
|
+
validate_event_keys(traces[2], @exit_kvs)
|
142
158
|
end
|
143
159
|
|
144
|
-
|
160
|
+
it 'should trace get' do
|
161
|
+
Oboe::API.start_trace('cassandra_test', '', {}) do
|
162
|
+
@client.get(:Statuses, '12', :reversed => true)
|
163
|
+
end
|
145
164
|
|
146
|
-
|
147
|
-
validate_outer_layers(traces, 'cassandra_test')
|
165
|
+
traces = get_all_traces
|
148
166
|
|
149
|
-
|
150
|
-
|
151
|
-
traces[1]['Cf'].must_equal "Users"
|
152
|
-
traces[1]['Key'].must_equal "[\"12\", \"5\"]"
|
153
|
-
traces[1].has_key?('Backtrace').must_equal Oboe::Config[:cassandra][:collect_backtraces]
|
154
|
-
validate_event_keys(traces[2], @exit_kvs)
|
155
|
-
end
|
167
|
+
traces.count.must_equal 4
|
168
|
+
validate_outer_layers(traces, 'cassandra_test')
|
156
169
|
|
157
|
-
|
158
|
-
|
159
|
-
|
170
|
+
validate_event_keys(traces[1], @entry_kvs)
|
171
|
+
traces[1]['Op'].must_equal "get"
|
172
|
+
traces[1]['Cf'].must_equal "Statuses"
|
173
|
+
traces[1]['Key'].must_equal "\"12\""
|
174
|
+
traces[1]['Reversed'].must_equal "true"
|
175
|
+
traces[1].has_key?('Backtrace').must_equal Oboe::Config[:cassandra][:collect_backtraces]
|
176
|
+
validate_event_keys(traces[2], @exit_kvs)
|
160
177
|
end
|
161
178
|
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
validate_event_keys(traces[1], @entry_kvs)
|
168
|
-
traces[1]['Op'].must_equal "get"
|
169
|
-
traces[1]['Cf'].must_equal "Statuses"
|
170
|
-
traces[1]['Key'].must_equal "\"12\""
|
171
|
-
traces[1]['Reversed'].must_equal "true"
|
172
|
-
traces[1].has_key?('Backtrace').must_equal Oboe::Config[:cassandra][:collect_backtraces]
|
173
|
-
validate_event_keys(traces[2], @exit_kvs)
|
174
|
-
end
|
175
|
-
|
176
|
-
it 'should trace exists?' do
|
177
|
-
Oboe::API.start_trace('cassandra_test', '', {}) do
|
178
|
-
@client.exists?(:Statuses, '12')
|
179
|
-
@client.exists?(:Statuses, '12', 'body')
|
180
|
-
end
|
179
|
+
it 'should trace exists?' do
|
180
|
+
Oboe::API.start_trace('cassandra_test', '', {}) do
|
181
|
+
@client.exists?(:Statuses, '12')
|
182
|
+
@client.exists?(:Statuses, '12', 'body')
|
183
|
+
end
|
181
184
|
|
182
|
-
|
185
|
+
traces = get_all_traces
|
183
186
|
|
184
|
-
|
185
|
-
|
187
|
+
traces.count.must_equal 6
|
188
|
+
validate_outer_layers(traces, 'cassandra_test')
|
186
189
|
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
190
|
+
validate_event_keys(traces[1], @entry_kvs)
|
191
|
+
traces[1]['Op'].must_equal "exists?"
|
192
|
+
traces[1]['Cf'].must_equal "Statuses"
|
193
|
+
traces[1]['Key'].must_equal "\"12\""
|
194
|
+
traces[1].has_key?('Backtrace').must_equal Oboe::Config[:cassandra][:collect_backtraces]
|
195
|
+
validate_event_keys(traces[2], @exit_kvs)
|
193
196
|
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
end
|
199
|
-
|
200
|
-
it 'should trace get_range_keys' do
|
201
|
-
Oboe::API.start_trace('cassandra_test', '', {}) do
|
202
|
-
@client.get_range_keys(:Statuses, :key_count => 4)
|
197
|
+
traces[3]['Op'].must_equal "exists?"
|
198
|
+
traces[3]['Cf'].must_equal "Statuses"
|
199
|
+
traces[3]['Key'].must_equal "\"12\""
|
200
|
+
traces[3].has_key?('Backtrace').must_equal Oboe::Config[:cassandra][:collect_backtraces]
|
203
201
|
end
|
204
202
|
|
205
|
-
|
203
|
+
it 'should trace get_range_keys' do
|
204
|
+
Oboe::API.start_trace('cassandra_test', '', {}) do
|
205
|
+
@client.get_range_keys(:Statuses, :key_count => 4)
|
206
|
+
end
|
206
207
|
|
207
|
-
|
208
|
-
validate_outer_layers(traces, 'cassandra_test')
|
208
|
+
traces = get_all_traces
|
209
209
|
|
210
|
-
|
211
|
-
|
212
|
-
traces[1]['Cf'].must_equal "Statuses"
|
213
|
-
traces[1].has_key?('Backtrace').must_equal Oboe::Config[:cassandra][:collect_backtraces]
|
214
|
-
validate_event_keys(traces[2], @exit_kvs)
|
215
|
-
end
|
210
|
+
traces.count.must_equal 4
|
211
|
+
validate_outer_layers(traces, 'cassandra_test')
|
216
212
|
|
217
|
-
|
218
|
-
|
219
|
-
|
213
|
+
validate_event_keys(traces[1], @entry_kvs)
|
214
|
+
traces[1]['Op'].must_equal "get_range_batch"
|
215
|
+
traces[1]['Cf'].must_equal "Statuses"
|
216
|
+
traces[1].has_key?('Backtrace').must_equal Oboe::Config[:cassandra][:collect_backtraces]
|
217
|
+
validate_event_keys(traces[2], @exit_kvs)
|
220
218
|
end
|
221
219
|
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
220
|
+
it 'should trace create_index' do
|
221
|
+
Oboe::API.start_trace('cassandra_test', '', {}) do
|
222
|
+
@client.create_index(@ks_name, 'Statuses', 'column_name', 'LongType')
|
223
|
+
end
|
226
224
|
|
227
|
-
|
228
|
-
traces[1]['Op'].must_equal "create_index"
|
229
|
-
traces[1]['Cf'].must_equal "Statuses"
|
230
|
-
traces[1]['Keyspace'].must_equal @ks_name
|
231
|
-
traces[1]['Column_name'].must_equal "column_name"
|
232
|
-
traces[1]['Validation_class'].must_equal "LongType"
|
233
|
-
traces[1].has_key?('Backtrace').must_equal Oboe::Config[:cassandra][:collect_backtraces]
|
234
|
-
validate_event_keys(traces[2], @exit_kvs)
|
225
|
+
traces = get_all_traces
|
235
226
|
|
236
|
-
|
237
|
-
|
238
|
-
end
|
227
|
+
traces.count.must_equal 4
|
228
|
+
validate_outer_layers(traces, 'cassandra_test')
|
239
229
|
|
240
|
-
|
241
|
-
|
242
|
-
|
230
|
+
validate_event_keys(traces[1], @entry_kvs)
|
231
|
+
traces[1]['Op'].must_equal "create_index"
|
232
|
+
traces[1]['Cf'].must_equal "Statuses"
|
233
|
+
traces[1]['Keyspace'].must_equal @ks_name
|
234
|
+
traces[1]['Column_name'].must_equal "column_name"
|
235
|
+
traces[1]['Validation_class'].must_equal "LongType"
|
236
|
+
traces[1].has_key?('Backtrace').must_equal Oboe::Config[:cassandra][:collect_backtraces]
|
237
|
+
validate_event_keys(traces[2], @exit_kvs)
|
243
238
|
|
244
|
-
|
239
|
+
# Clean up
|
245
240
|
@client.drop_index(@ks_name, 'Statuses', 'column_name')
|
246
241
|
end
|
247
242
|
|
248
|
-
|
243
|
+
it 'should trace drop_index' do
|
244
|
+
# Prep
|
245
|
+
@client.create_index(@ks_name, 'Statuses', 'column_name', 'LongType')
|
249
246
|
|
250
|
-
|
251
|
-
|
247
|
+
Oboe::API.start_trace('cassandra_test', '', {}) do
|
248
|
+
@client.drop_index(@ks_name, 'Statuses', 'column_name')
|
249
|
+
end
|
252
250
|
|
253
|
-
|
254
|
-
traces[1]['Op'].must_equal "drop_index"
|
255
|
-
traces[1]['Cf'].must_equal "Statuses"
|
256
|
-
traces[1]['Keyspace'].must_equal @ks_name
|
257
|
-
traces[1]['Column_name'].must_equal "column_name"
|
258
|
-
traces[1].has_key?('Backtrace').must_equal Oboe::Config[:cassandra][:collect_backtraces]
|
259
|
-
validate_event_keys(traces[2], @exit_kvs)
|
260
|
-
end
|
251
|
+
traces = get_all_traces
|
261
252
|
|
262
|
-
|
263
|
-
|
264
|
-
Oboe::API.start_trace('cassandra_test', '', {}) do
|
265
|
-
expressions = [
|
266
|
-
{ :column_name => 'x',
|
267
|
-
:value => [0,20].pack("NN"),
|
268
|
-
:comparison => "=="},
|
269
|
-
{ :column_name => 'non_indexed',
|
270
|
-
:value => [5].pack("N*"),
|
271
|
-
:comparison => ">"} ]
|
272
|
-
@client.get_indexed_slices(:Statuses, expressions).length
|
273
|
-
end
|
253
|
+
traces.count.must_equal 4
|
254
|
+
validate_outer_layers(traces, 'cassandra_test')
|
274
255
|
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
256
|
+
validate_event_keys(traces[1], @entry_kvs)
|
257
|
+
traces[1]['Op'].must_equal "drop_index"
|
258
|
+
traces[1]['Cf'].must_equal "Statuses"
|
259
|
+
traces[1]['Keyspace'].must_equal @ks_name
|
260
|
+
traces[1]['Column_name'].must_equal "column_name"
|
261
|
+
traces[1].has_key?('Backtrace').must_equal Oboe::Config[:cassandra][:collect_backtraces]
|
262
|
+
validate_event_keys(traces[2], @exit_kvs)
|
263
|
+
end
|
279
264
|
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
265
|
+
it 'should trace get_indexed_slices' do
|
266
|
+
@client.create_index(@ks_name, 'Statuses', 'x', 'LongType')
|
267
|
+
Oboe::API.start_trace('cassandra_test', '', {}) do
|
268
|
+
expressions = [
|
269
|
+
{ :column_name => 'x',
|
270
|
+
:value => [0,20].pack("NN"),
|
271
|
+
:comparison => "=="},
|
272
|
+
{ :column_name => 'non_indexed',
|
273
|
+
:value => [5].pack("N*"),
|
274
|
+
:comparison => ">"} ]
|
275
|
+
@client.get_indexed_slices(:Statuses, expressions).length
|
276
|
+
end
|
277
|
+
|
278
|
+
traces = get_all_traces
|
279
|
+
|
280
|
+
traces.count.must_equal 4
|
281
|
+
validate_outer_layers(traces, 'cassandra_test')
|
282
|
+
|
283
|
+
validate_event_keys(traces[1], @entry_kvs)
|
284
|
+
traces[1]['Op'].must_equal "get_indexed_slices"
|
285
|
+
traces[1]['Cf'].must_equal "Statuses"
|
286
|
+
traces[1].has_key?('Backtrace').must_equal Oboe::Config[:cassandra][:collect_backtraces]
|
287
|
+
validate_event_keys(traces[2], @exit_kvs)
|
288
|
+
end
|
286
289
|
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
+
it 'should trace add and remove of column family' do
|
291
|
+
cf_name = (0...10).map{ ('a'..'z').to_a[rand(26)] }.join
|
292
|
+
cf_def = CassandraThrift::CfDef.new(:keyspace => @ks_name, :name => cf_name)
|
290
293
|
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
294
|
+
Oboe::API.start_trace('cassandra_test', '', {}) do
|
295
|
+
@client.add_column_family(cf_def)
|
296
|
+
@client.drop_column_family(cf_name)
|
297
|
+
end
|
295
298
|
|
296
|
-
|
299
|
+
traces = get_all_traces
|
297
300
|
|
298
|
-
|
299
|
-
|
301
|
+
traces.count.must_equal 6
|
302
|
+
validate_outer_layers(traces, 'cassandra_test')
|
300
303
|
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
304
|
+
validate_event_keys(traces[1], @entry_kvs)
|
305
|
+
traces[1]['Op'].must_equal "add_column_family"
|
306
|
+
traces[1].has_key?('Backtrace').must_equal Oboe::Config[:cassandra][:collect_backtraces]
|
307
|
+
validate_event_keys(traces[2], @exit_kvs)
|
305
308
|
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
309
|
+
traces[3]['Op'].must_equal "drop_column_family"
|
310
|
+
traces[3]['Cf'].must_equal cf_name
|
311
|
+
traces[3].has_key?('Backtrace').must_equal Oboe::Config[:cassandra][:collect_backtraces]
|
312
|
+
end
|
310
313
|
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
314
|
+
it 'should trace adding a keyspace' do
|
315
|
+
ks_name = (0...10).map{ ('a'..'z').to_a[rand(26)] }.join
|
316
|
+
column_families = [{:name =>"a"}, {:name => "b", :type => :super}]
|
317
|
+
ks_def = CassandraThrift::KsDef.new(:name => ks_name,
|
318
|
+
:strategy_class => "org.apache.cassandra.locator.SimpleStrategy",
|
319
|
+
:strategy_options => { 'replication_factor' => '2' },
|
320
|
+
:cf_defs => [])
|
321
|
+
|
322
|
+
Oboe::API.start_trace('cassandra_test', '', {}) do
|
323
|
+
@client.add_keyspace(ks_def)
|
324
|
+
@client.keyspace = ks_name
|
325
|
+
end
|
326
|
+
|
327
|
+
traces = get_all_traces
|
328
|
+
|
329
|
+
traces.count.must_equal 4
|
330
|
+
validate_outer_layers(traces, 'cassandra_test')
|
331
|
+
|
332
|
+
validate_event_keys(traces[1], @entry_kvs)
|
333
|
+
traces[1]['Op'].must_equal "add_keyspace"
|
334
|
+
traces[1]['Name'].must_equal ks_name
|
335
|
+
traces[1].has_key?('Backtrace').must_equal Oboe::Config[:cassandra][:collect_backtraces]
|
336
|
+
validate_event_keys(traces[2], @exit_kvs)
|
322
337
|
end
|
323
338
|
|
324
|
-
|
339
|
+
it 'should trace the removal of a keyspace' do
|
340
|
+
Oboe::API.start_trace('cassandra_test', '', {}) do
|
341
|
+
@client.drop_keyspace(@ks_name)
|
342
|
+
end
|
325
343
|
|
326
|
-
|
327
|
-
validate_outer_layers(traces, 'cassandra_test')
|
344
|
+
traces = get_all_traces
|
328
345
|
|
329
|
-
|
330
|
-
|
331
|
-
traces[1]['Name'].must_equal ks_name
|
332
|
-
traces[1].has_key?('Backtrace').must_equal Oboe::Config[:cassandra][:collect_backtraces]
|
333
|
-
validate_event_keys(traces[2], @exit_kvs)
|
334
|
-
end
|
346
|
+
traces.count.must_equal 4
|
347
|
+
validate_outer_layers(traces, 'cassandra_test')
|
335
348
|
|
336
|
-
|
337
|
-
|
338
|
-
|
349
|
+
validate_event_keys(traces[1], @entry_kvs)
|
350
|
+
traces[1]['Op'].must_equal "drop_keyspace"
|
351
|
+
traces[1]['Name'].must_equal @ks_name
|
352
|
+
traces[1].has_key?('Backtrace').must_equal Oboe::Config[:cassandra][:collect_backtraces]
|
353
|
+
validate_event_keys(traces[2], @exit_kvs)
|
339
354
|
end
|
340
355
|
|
341
|
-
|
356
|
+
it "should obey :collect_backtraces setting when true" do
|
357
|
+
Oboe::Config[:cassandra][:collect_backtraces] = true
|
342
358
|
|
343
|
-
|
344
|
-
|
359
|
+
Oboe::API.start_trace('cassandra_test', '', {}) do
|
360
|
+
user = {'screen_name' => 'larry', "blah" => "ok"}
|
361
|
+
@client.insert(:Users, '5', user, { :ttl => 600, :consistency => 1})
|
362
|
+
end
|
345
363
|
|
346
|
-
|
347
|
-
|
348
|
-
traces[1]['Name'].must_equal @ks_name
|
349
|
-
traces[1].has_key?('Backtrace').must_equal Oboe::Config[:cassandra][:collect_backtraces]
|
350
|
-
validate_event_keys(traces[2], @exit_kvs)
|
351
|
-
end
|
352
|
-
|
353
|
-
it "should obey :collect_backtraces setting when true" do
|
354
|
-
Oboe::Config[:cassandra][:collect_backtraces] = true
|
355
|
-
|
356
|
-
Oboe::API.start_trace('cassandra_test', '', {}) do
|
357
|
-
user = {'screen_name' => 'larry', "blah" => "ok"}
|
358
|
-
@client.insert(:Users, '5', user, { :ttl => 600, :consistency => 1})
|
364
|
+
traces = get_all_traces
|
365
|
+
layer_has_key(traces, 'cassandra', 'Backtrace')
|
359
366
|
end
|
360
367
|
|
361
|
-
|
362
|
-
|
363
|
-
end
|
368
|
+
it "should obey :collect_backtraces setting when false" do
|
369
|
+
Oboe::Config[:cassandra][:collect_backtraces] = false
|
364
370
|
|
365
|
-
|
366
|
-
|
371
|
+
Oboe::API.start_trace('cassandra_test', '', {}) do
|
372
|
+
user = {'screen_name' => 'larry', "blah" => "ok"}
|
373
|
+
@client.insert(:Users, '5', user, { :ttl => 600, :consistency => 1})
|
374
|
+
end
|
367
375
|
|
368
|
-
|
369
|
-
|
370
|
-
@client.insert(:Users, '5', user, { :ttl => 600, :consistency => 1})
|
376
|
+
traces = get_all_traces
|
377
|
+
layer_doesnt_have_key(traces, 'cassandra', 'Backtrace')
|
371
378
|
end
|
372
379
|
|
373
|
-
traces = get_all_traces
|
374
|
-
layer_doesnt_have_key(traces, 'cassandra', 'Backtrace')
|
375
380
|
end
|
376
|
-
|
377
381
|
end
|