oboe 2.6.6.1 → 2.6.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +6 -0
- data/Appraisals +6 -16
- data/CHANGELOG.md +30 -14
- data/Gemfile +4 -3
- data/Gemfile.lock +20 -25
- data/Rakefile +5 -1
- data/ext/oboe_metal/extconf.rb +2 -2
- data/gemfiles/mongo.gemfile +33 -0
- data/gemfiles/moped.gemfile +33 -0
- data/lib/base.rb +28 -10
- data/lib/joboe_metal.rb +12 -34
- data/lib/method_profiling.rb +3 -3
- data/lib/oboe/api/layerinit.rb +14 -14
- data/lib/oboe/api/logging.rb +11 -11
- data/lib/oboe/api/profiling.rb +7 -6
- data/lib/oboe/api/tracing.rb +3 -3
- data/lib/oboe/api/util.rb +4 -4
- data/lib/oboe/config.rb +7 -7
- data/lib/oboe/frameworks/padrino.rb +2 -2
- data/lib/oboe/frameworks/rails.rb +11 -11
- data/lib/oboe/frameworks/rails/inst/action_controller.rb +4 -4
- data/lib/oboe/frameworks/rails/inst/action_view.rb +2 -2
- data/lib/oboe/frameworks/rails/inst/action_view_2x.rb +1 -1
- data/lib/oboe/frameworks/rails/inst/action_view_30.rb +1 -1
- data/lib/oboe/frameworks/rails/inst/active_record.rb +1 -1
- data/lib/oboe/frameworks/rails/inst/connection_adapters/mysql.rb +3 -3
- data/lib/oboe/frameworks/rails/inst/connection_adapters/mysql2.rb +2 -2
- data/lib/oboe/frameworks/rails/inst/connection_adapters/postgresql.rb +1 -1
- data/lib/oboe/frameworks/rails/inst/connection_adapters/utils.rb +8 -8
- data/lib/oboe/frameworks/sinatra.rb +33 -3
- data/lib/oboe/frameworks/sinatra/templates.rb +2 -2
- data/lib/oboe/inst/cassandra.rb +19 -19
- data/lib/oboe/inst/dalli.rb +7 -7
- data/lib/oboe/inst/http.rb +5 -5
- data/lib/oboe/inst/memcache.rb +14 -14
- data/lib/oboe/inst/memcached.rb +8 -8
- data/lib/oboe/inst/mongo.rb +2 -2
- data/lib/oboe/inst/moped.rb +29 -29
- data/lib/oboe/inst/rack.rb +3 -3
- data/lib/oboe/inst/redis.rb +24 -24
- data/lib/oboe/inst/resque.rb +4 -4
- data/lib/oboe/loading.rb +6 -6
- data/lib/oboe/logger.rb +4 -4
- data/lib/oboe/version.rb +1 -1
- data/lib/oboe_metal.rb +11 -39
- data/test/frameworks/apps/grape_simple.rb +1 -1
- data/test/frameworks/apps/sinatra_simple.rb +1 -1
- data/test/frameworks/padrino_test.rb +3 -3
- data/test/frameworks/sinatra_test.rb +3 -3
- data/test/instrumentation/cassandra_test.rb +45 -45
- data/test/instrumentation/http_test.rb +6 -6
- data/test/instrumentation/mongo_test.rb +347 -345
- data/test/instrumentation/moped_test.rb +40 -40
- data/test/instrumentation/redis_hashes_test.rb +20 -20
- data/test/instrumentation/redis_keys_test.rb +19 -19
- data/test/instrumentation/redis_lists_test.rb +22 -22
- data/test/instrumentation/redis_misc_test.rb +14 -14
- data/test/instrumentation/redis_sets_test.rb +20 -20
- data/test/instrumentation/redis_sortedsets_test.rb +25 -25
- data/test/instrumentation/redis_strings_test.rb +27 -27
- data/test/instrumentation/resque_test.rb +7 -7
- data/test/minitest_helper.rb +18 -6
- data/test/profiling/method_test.rb +24 -24
- data/test/support/liboboe_settings_test.rb +3 -3
- data/test/support/xtrace_test.rb +2 -2
- metadata +26 -32
- data/gemfiles/rails2.3.gemfile +0 -18
- data/gemfiles/rails2.3.gemfile.lock +0 -95
- data/gemfiles/rails3.0.gemfile +0 -18
- data/gemfiles/rails3.0.gemfile.lock +0 -142
- data/gemfiles/rails3.1.gemfile +0 -18
- data/gemfiles/rails3.1.gemfile.lock +0 -152
- data/gemfiles/rails3.2.gemfile +0 -18
- data/gemfiles/rails3.2.gemfile.lock +0 -150
data/lib/oboe/inst/resque.rb
CHANGED
@@ -21,7 +21,7 @@ module Oboe
|
|
21
21
|
|
22
22
|
if Oboe::Config[:resque][:log_args]
|
23
23
|
kv_args = args.to_json
|
24
|
-
|
24
|
+
|
25
25
|
# Limit the argument json string to 1024 bytes
|
26
26
|
if kv_args.length > 1024
|
27
27
|
report_kvs[:Args] = kv_args[0..1023] + '...[snipped]'
|
@@ -29,7 +29,7 @@ module Oboe
|
|
29
29
|
report_kvs[:Args] = kv_args
|
30
30
|
end
|
31
31
|
end
|
32
|
-
|
32
|
+
|
33
33
|
report_kvs[:Backtrace] = Oboe::API.backtrace if Oboe::Config[:resque][:collect_backtraces]
|
34
34
|
rescue
|
35
35
|
end
|
@@ -94,12 +94,12 @@ module Oboe
|
|
94
94
|
report_kvs[:URL] = '/resque/' + job.queue
|
95
95
|
report_kvs[:Method] = 'NONE'
|
96
96
|
report_kvs[:Queue] = job.queue
|
97
|
-
|
97
|
+
|
98
98
|
report_kvs[:Class] = job.payload['class']
|
99
99
|
|
100
100
|
if Oboe::Config[:resque][:log_args]
|
101
101
|
kv_args = job.payload['args'].to_json
|
102
|
-
|
102
|
+
|
103
103
|
# Limit the argument json string to 1024 bytes
|
104
104
|
if kv_args.length > 1024
|
105
105
|
report_kvs[:Args] = kv_args[0..1023] + '...[snipped]'
|
data/lib/oboe/loading.rb
CHANGED
@@ -27,13 +27,13 @@ module Oboe
|
|
27
27
|
end
|
28
28
|
|
29
29
|
##
|
30
|
-
# This module houses all of the loading functionality for the oboe gem.
|
30
|
+
# This module houses all of the loading functionality for the oboe gem.
|
31
31
|
#
|
32
|
-
# Note that this does not necessarily _have_ to include initialization routines
|
32
|
+
# Note that this does not necessarily _have_ to include initialization routines
|
33
33
|
# (although it can).
|
34
34
|
#
|
35
35
|
# Actual initialization is often separated out as it can be dependent on on the state
|
36
|
-
# of the stack boot process. e.g. code requiring that initializers, frameworks or
|
36
|
+
# of the stack boot process. e.g. code requiring that initializers, frameworks or
|
37
37
|
# instrumented libraries are already loaded...
|
38
38
|
#
|
39
39
|
module Loading
|
@@ -52,7 +52,7 @@ module Oboe
|
|
52
52
|
if Oboe::Config.access_key.empty?
|
53
53
|
config_file = '/etc/tracelytics.conf'
|
54
54
|
return unless File.exists?(config_file)
|
55
|
-
|
55
|
+
|
56
56
|
File.open(config_file).each do |line|
|
57
57
|
if line =~ /^tracelyzer.access_key=/ or line =~ /^access_key/
|
58
58
|
bits = line.split(/=/)
|
@@ -63,14 +63,14 @@ module Oboe
|
|
63
63
|
end
|
64
64
|
end
|
65
65
|
end
|
66
|
-
rescue
|
66
|
+
rescue StandardError => e
|
67
67
|
Oboe.logger.error "Trouble obtaining access_key and rum_id: #{e.inspect}"
|
68
68
|
end
|
69
69
|
end
|
70
70
|
|
71
71
|
##
|
72
72
|
# Load the oboe tracing API
|
73
|
-
#
|
73
|
+
#
|
74
74
|
def self.require_api
|
75
75
|
pattern = File.join(File.dirname(__FILE__), 'api', '*.rb')
|
76
76
|
Dir.glob(pattern) do |f|
|
data/lib/oboe/logger.rb
CHANGED
@@ -13,22 +13,22 @@ module Oboe
|
|
13
13
|
def fatal(string, exception = nil)
|
14
14
|
Oboe.logger.fatal(string) if Oboe.logger
|
15
15
|
end
|
16
|
-
|
16
|
+
|
17
17
|
# Error message
|
18
18
|
def error(msg, exception = nil)
|
19
19
|
Oboe.logger.error(string) if Oboe.logger
|
20
20
|
end
|
21
|
-
|
21
|
+
|
22
22
|
# Warn message
|
23
23
|
def warn(msg, exception = nil)
|
24
24
|
Oboe.logger.warn(string) if Oboe.logger
|
25
25
|
end
|
26
|
-
|
26
|
+
|
27
27
|
# Info message
|
28
28
|
def info(msg, exception = nil)
|
29
29
|
Oboe.logger.info(string) if Oboe.logger
|
30
30
|
end
|
31
|
-
|
31
|
+
|
32
32
|
# Debug message
|
33
33
|
def debug(msg, exception = nil)
|
34
34
|
Oboe.logger.debug(string) if Oboe.logger
|
data/lib/oboe/version.rb
CHANGED
data/lib/oboe_metal.rb
CHANGED
@@ -3,40 +3,9 @@
|
|
3
3
|
|
4
4
|
require 'base'
|
5
5
|
|
6
|
-
module
|
7
|
-
|
8
|
-
|
9
|
-
attr_accessor :layer_op
|
10
|
-
|
11
|
-
def log(layer, label, options = {}, with_backtrace = false)
|
12
|
-
evt = Oboe::Context.createEvent()
|
13
|
-
evt.addInfo("Layer", layer.to_s)
|
14
|
-
evt.addInfo("Label", label.to_s)
|
15
|
-
|
16
|
-
options.each_pair do |k, v|
|
17
|
-
evt.addInfo(k.to_s, v.to_s)
|
18
|
-
end
|
19
|
-
|
20
|
-
evt.addInfo("Backtrace", Oboe::API.backtrace) if with_backtrace
|
21
|
-
|
22
|
-
Oboe.reporter.sendReport(evt)
|
23
|
-
end
|
24
|
-
|
25
|
-
def tracing_layer_op?(operation)
|
26
|
-
if operation.is_a?(Array)
|
27
|
-
return operation.include?(@layer_op)
|
28
|
-
else
|
29
|
-
return @layer_op == operation
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
class Event
|
36
|
-
def self.metadataString(evt)
|
37
|
-
evt.metadataString()
|
38
|
-
end
|
39
|
-
end
|
6
|
+
module Oboe
|
7
|
+
extend OboeBase
|
8
|
+
include Oboe_metal
|
40
9
|
|
41
10
|
class Reporter
|
42
11
|
##
|
@@ -46,7 +15,7 @@ module Oboe_metal
|
|
46
15
|
return unless Oboe.loaded
|
47
16
|
|
48
17
|
begin
|
49
|
-
Oboe_metal::Context.init()
|
18
|
+
Oboe_metal::Context.init()
|
50
19
|
|
51
20
|
if ENV['RACK_ENV'] == "test"
|
52
21
|
Oboe.reporter = Oboe::FileReporter.new("/tmp/trace_output.bson")
|
@@ -70,15 +39,18 @@ module Oboe_metal
|
|
70
39
|
Oboe.reporter.sendReport(evt)
|
71
40
|
end
|
72
41
|
end
|
73
|
-
end
|
74
42
|
|
75
|
-
|
76
|
-
|
77
|
-
|
43
|
+
class Event
|
44
|
+
def self.metadataString(evt)
|
45
|
+
evt.metadataString()
|
46
|
+
end
|
47
|
+
end
|
78
48
|
|
79
49
|
class << self
|
80
50
|
def sample?(opts = {})
|
81
51
|
begin
|
52
|
+
return false unless Oboe.always?
|
53
|
+
|
82
54
|
# Assure defaults since SWIG enforces Strings
|
83
55
|
layer = opts[:layer] ? opts[:layer].strip : ''
|
84
56
|
xtrace = opts[:xtrace] ? opts[:xtrace].strip : ''
|
@@ -4,14 +4,14 @@ if RUBY_VERSION >= '1.9.3'
|
|
4
4
|
|
5
5
|
describe Padrino do
|
6
6
|
before do
|
7
|
-
clear_all_traces
|
7
|
+
clear_all_traces
|
8
8
|
end
|
9
9
|
|
10
10
|
it "should trace a request to a simple padrino stack" do
|
11
11
|
@app = SimpleDemo
|
12
|
-
|
12
|
+
|
13
13
|
r = get "/render"
|
14
|
-
|
14
|
+
|
15
15
|
traces = get_all_traces
|
16
16
|
traces.count.must_equal 9
|
17
17
|
|
@@ -3,14 +3,14 @@ require File.expand_path(File.dirname(__FILE__) + '/apps/sinatra_simple')
|
|
3
3
|
|
4
4
|
describe Sinatra do
|
5
5
|
before do
|
6
|
-
clear_all_traces
|
6
|
+
clear_all_traces
|
7
7
|
end
|
8
8
|
|
9
9
|
it "should trace a request to a simple sinatra stack" do
|
10
10
|
@app = SinatraSimple
|
11
|
-
|
11
|
+
|
12
12
|
r = get "/render"
|
13
|
-
|
13
|
+
|
14
14
|
traces = get_all_traces
|
15
15
|
traces.count.must_equal 9
|
16
16
|
|
@@ -2,26 +2,26 @@ require 'minitest_helper'
|
|
2
2
|
|
3
3
|
describe Oboe::Inst::Cassandra do
|
4
4
|
before do
|
5
|
-
clear_all_traces
|
5
|
+
clear_all_traces
|
6
6
|
|
7
7
|
@client = Cassandra.new("system", "127.0.0.1:9160", { :timeout => 10 })
|
8
8
|
@client.disable_node_auto_discovery!
|
9
9
|
|
10
10
|
@ks_name = "AppNetaCassandraTest"
|
11
|
-
|
11
|
+
|
12
12
|
ks_def = CassandraThrift::KsDef.new(:name => @ks_name,
|
13
13
|
:strategy_class => "SimpleStrategy",
|
14
14
|
:strategy_options => { 'replication_factor' => '2' },
|
15
15
|
:cf_defs => [])
|
16
|
-
|
16
|
+
|
17
17
|
@client.add_keyspace(ks_def) unless @client.keyspaces.include? @ks_name
|
18
18
|
@client.keyspace = @ks_name
|
19
|
-
|
19
|
+
|
20
20
|
unless @client.column_families.include? "Users"
|
21
21
|
cf_def = CassandraThrift::CfDef.new(:keyspace => @ks_name, :name => "Users")
|
22
22
|
@client.add_column_family(cf_def)
|
23
23
|
end
|
24
|
-
|
24
|
+
|
25
25
|
unless @client.column_families.include? "Statuses"
|
26
26
|
cf_def = CassandraThrift::CfDef.new(:keyspace => @ks_name, :name => "Statuses")
|
27
27
|
@client.add_column_family(cf_def)
|
@@ -44,7 +44,7 @@ describe Oboe::Inst::Cassandra do
|
|
44
44
|
end
|
45
45
|
|
46
46
|
it 'Stock Cassandra should be loaded, defined and ready' do
|
47
|
-
defined?(::Cassandra).wont_match nil
|
47
|
+
defined?(::Cassandra).wont_match nil
|
48
48
|
end
|
49
49
|
|
50
50
|
it 'Cassandra should have oboe methods defined' do
|
@@ -57,15 +57,15 @@ describe Oboe::Inst::Cassandra do
|
|
57
57
|
# Special 'exists?' case
|
58
58
|
::Cassandra.method_defined?("exists_with_oboe?").must_equal true
|
59
59
|
end
|
60
|
-
|
60
|
+
|
61
61
|
it 'should trace insert' do
|
62
62
|
Oboe::API.start_trace('cassandra_test', '', {}) do
|
63
63
|
user = {'screen_name' => 'larry', "blah" => "ok"}
|
64
64
|
@client.insert(:Users, '5', user, { :ttl => 600, :consistency => 1})
|
65
65
|
end
|
66
|
-
|
66
|
+
|
67
67
|
traces = get_all_traces
|
68
|
-
|
68
|
+
|
69
69
|
traces.count.must_equal 4
|
70
70
|
validate_outer_layers(traces, 'cassandra_test')
|
71
71
|
|
@@ -83,9 +83,9 @@ describe Oboe::Inst::Cassandra do
|
|
83
83
|
Oboe::API.start_trace('cassandra_test', '', {}) do
|
84
84
|
@client.remove(:Users, '5', 'blah')
|
85
85
|
end
|
86
|
-
|
86
|
+
|
87
87
|
traces = get_all_traces
|
88
|
-
|
88
|
+
|
89
89
|
traces.count.must_equal 4
|
90
90
|
validate_outer_layers(traces, 'cassandra_test')
|
91
91
|
|
@@ -96,16 +96,16 @@ describe Oboe::Inst::Cassandra do
|
|
96
96
|
traces[1].has_key?('Backtrace').must_equal Oboe::Config[:cassandra][:collect_backtraces]
|
97
97
|
validate_event_keys(traces[2], @exit_kvs)
|
98
98
|
end
|
99
|
-
|
99
|
+
|
100
100
|
it 'should trace count_columns' do
|
101
101
|
@client.insert(:Statuses, '12', {'body' => 'v1', 'user' => 'v2'})
|
102
|
-
|
102
|
+
|
103
103
|
Oboe::API.start_trace('cassandra_test', '', {}) do
|
104
104
|
@client.count_columns(:Statuses, '12', :count => 50)
|
105
105
|
end
|
106
|
-
|
106
|
+
|
107
107
|
traces = get_all_traces
|
108
|
-
|
108
|
+
|
109
109
|
traces.count.must_equal 4
|
110
110
|
validate_outer_layers(traces, 'cassandra_test')
|
111
111
|
|
@@ -122,9 +122,9 @@ describe Oboe::Inst::Cassandra do
|
|
122
122
|
Oboe::API.start_trace('cassandra_test', '', {}) do
|
123
123
|
@client.get_columns(:Statuses, '12', ['body'])
|
124
124
|
end
|
125
|
-
|
125
|
+
|
126
126
|
traces = get_all_traces
|
127
|
-
|
127
|
+
|
128
128
|
traces.count.must_equal 4
|
129
129
|
validate_outer_layers(traces, 'cassandra_test')
|
130
130
|
|
@@ -140,9 +140,9 @@ describe Oboe::Inst::Cassandra do
|
|
140
140
|
Oboe::API.start_trace('cassandra_test', '', {}) do
|
141
141
|
@client.multi_get_columns(:Users, ['12', '5'], ['body'])
|
142
142
|
end
|
143
|
-
|
143
|
+
|
144
144
|
traces = get_all_traces
|
145
|
-
|
145
|
+
|
146
146
|
traces.count.must_equal 4
|
147
147
|
validate_outer_layers(traces, 'cassandra_test')
|
148
148
|
|
@@ -158,9 +158,9 @@ describe Oboe::Inst::Cassandra do
|
|
158
158
|
Oboe::API.start_trace('cassandra_test', '', {}) do
|
159
159
|
@client.get(:Statuses, '12', :reversed => true)
|
160
160
|
end
|
161
|
-
|
161
|
+
|
162
162
|
traces = get_all_traces
|
163
|
-
|
163
|
+
|
164
164
|
traces.count.must_equal 4
|
165
165
|
validate_outer_layers(traces, 'cassandra_test')
|
166
166
|
|
@@ -178,9 +178,9 @@ describe Oboe::Inst::Cassandra do
|
|
178
178
|
@client.exists?(:Statuses, '12')
|
179
179
|
@client.exists?(:Statuses, '12', 'body')
|
180
180
|
end
|
181
|
-
|
181
|
+
|
182
182
|
traces = get_all_traces
|
183
|
-
|
183
|
+
|
184
184
|
traces.count.must_equal 6
|
185
185
|
validate_outer_layers(traces, 'cassandra_test')
|
186
186
|
|
@@ -190,7 +190,7 @@ describe Oboe::Inst::Cassandra do
|
|
190
190
|
traces[1]['Key'].must_equal "\"12\""
|
191
191
|
traces[1].has_key?('Backtrace').must_equal Oboe::Config[:cassandra][:collect_backtraces]
|
192
192
|
validate_event_keys(traces[2], @exit_kvs)
|
193
|
-
|
193
|
+
|
194
194
|
traces[3]['Op'].must_equal "exists?"
|
195
195
|
traces[3]['Cf'].must_equal "Statuses"
|
196
196
|
traces[3]['Key'].must_equal "\"12\""
|
@@ -201,9 +201,9 @@ describe Oboe::Inst::Cassandra do
|
|
201
201
|
Oboe::API.start_trace('cassandra_test', '', {}) do
|
202
202
|
@client.get_range_keys(:Statuses, :key_count => 4)
|
203
203
|
end
|
204
|
-
|
204
|
+
|
205
205
|
traces = get_all_traces
|
206
|
-
|
206
|
+
|
207
207
|
traces.count.must_equal 4
|
208
208
|
validate_outer_layers(traces, 'cassandra_test')
|
209
209
|
|
@@ -220,7 +220,7 @@ describe Oboe::Inst::Cassandra do
|
|
220
220
|
end
|
221
221
|
|
222
222
|
traces = get_all_traces
|
223
|
-
|
223
|
+
|
224
224
|
traces.count.must_equal 4
|
225
225
|
validate_outer_layers(traces, 'cassandra_test')
|
226
226
|
|
@@ -232,11 +232,11 @@ describe Oboe::Inst::Cassandra do
|
|
232
232
|
traces[1]['Validation_class'].must_equal "LongType"
|
233
233
|
traces[1].has_key?('Backtrace').must_equal Oboe::Config[:cassandra][:collect_backtraces]
|
234
234
|
validate_event_keys(traces[2], @exit_kvs)
|
235
|
-
|
235
|
+
|
236
236
|
# Clean up
|
237
237
|
@client.drop_index(@ks_name, 'Statuses', 'column_name')
|
238
238
|
end
|
239
|
-
|
239
|
+
|
240
240
|
it 'should trace drop_index' do
|
241
241
|
# Prep
|
242
242
|
@client.create_index(@ks_name, 'Statuses', 'column_name', 'LongType')
|
@@ -244,9 +244,9 @@ describe Oboe::Inst::Cassandra do
|
|
244
244
|
Oboe::API.start_trace('cassandra_test', '', {}) do
|
245
245
|
@client.drop_index(@ks_name, 'Statuses', 'column_name')
|
246
246
|
end
|
247
|
-
|
247
|
+
|
248
248
|
traces = get_all_traces
|
249
|
-
|
249
|
+
|
250
250
|
traces.count.must_equal 4
|
251
251
|
validate_outer_layers(traces, 'cassandra_test')
|
252
252
|
|
@@ -271,9 +271,9 @@ describe Oboe::Inst::Cassandra do
|
|
271
271
|
:comparison => ">"} ]
|
272
272
|
@client.get_indexed_slices(:Statuses, expressions).length
|
273
273
|
end
|
274
|
-
|
274
|
+
|
275
275
|
traces = get_all_traces
|
276
|
-
|
276
|
+
|
277
277
|
traces.count.must_equal 4
|
278
278
|
validate_outer_layers(traces, 'cassandra_test')
|
279
279
|
|
@@ -283,7 +283,7 @@ describe Oboe::Inst::Cassandra do
|
|
283
283
|
traces[1].has_key?('Backtrace').must_equal Oboe::Config[:cassandra][:collect_backtraces]
|
284
284
|
validate_event_keys(traces[2], @exit_kvs)
|
285
285
|
end
|
286
|
-
|
286
|
+
|
287
287
|
it 'should trace add and remove of column family' do
|
288
288
|
cf_name = (0...10).map{ ('a'..'z').to_a[rand(26)] }.join
|
289
289
|
cf_def = CassandraThrift::CfDef.new(:keyspace => @ks_name, :name => cf_name)
|
@@ -292,9 +292,9 @@ describe Oboe::Inst::Cassandra do
|
|
292
292
|
@client.add_column_family(cf_def)
|
293
293
|
@client.drop_column_family(cf_name)
|
294
294
|
end
|
295
|
-
|
295
|
+
|
296
296
|
traces = get_all_traces
|
297
|
-
|
297
|
+
|
298
298
|
traces.count.must_equal 6
|
299
299
|
validate_outer_layers(traces, 'cassandra_test')
|
300
300
|
|
@@ -302,12 +302,12 @@ describe Oboe::Inst::Cassandra do
|
|
302
302
|
traces[1]['Op'].must_equal "add_column_family"
|
303
303
|
traces[1].has_key?('Backtrace').must_equal Oboe::Config[:cassandra][:collect_backtraces]
|
304
304
|
validate_event_keys(traces[2], @exit_kvs)
|
305
|
-
|
305
|
+
|
306
306
|
traces[3]['Op'].must_equal "drop_column_family"
|
307
307
|
traces[3]['Cf'].must_equal cf_name
|
308
308
|
traces[3].has_key?('Backtrace').must_equal Oboe::Config[:cassandra][:collect_backtraces]
|
309
309
|
end
|
310
|
-
|
310
|
+
|
311
311
|
it 'should trace adding a keyspace' do
|
312
312
|
ks_name = (0...10).map{ ('a'..'z').to_a[rand(26)] }.join
|
313
313
|
column_families = [{:name =>"a"}, {:name => "b", :type => :super}]
|
@@ -320,9 +320,9 @@ describe Oboe::Inst::Cassandra do
|
|
320
320
|
@client.add_keyspace(ks_def)
|
321
321
|
@client.keyspace = ks_name
|
322
322
|
end
|
323
|
-
|
323
|
+
|
324
324
|
traces = get_all_traces
|
325
|
-
|
325
|
+
|
326
326
|
traces.count.must_equal 4
|
327
327
|
validate_outer_layers(traces, 'cassandra_test')
|
328
328
|
|
@@ -332,14 +332,14 @@ describe Oboe::Inst::Cassandra do
|
|
332
332
|
traces[1].has_key?('Backtrace').must_equal Oboe::Config[:cassandra][:collect_backtraces]
|
333
333
|
validate_event_keys(traces[2], @exit_kvs)
|
334
334
|
end
|
335
|
-
|
335
|
+
|
336
336
|
it 'should trace the removal of a keyspace' do
|
337
337
|
Oboe::API.start_trace('cassandra_test', '', {}) do
|
338
338
|
@client.drop_keyspace(@ks_name)
|
339
339
|
end
|
340
|
-
|
340
|
+
|
341
341
|
traces = get_all_traces
|
342
|
-
|
342
|
+
|
343
343
|
traces.count.must_equal 4
|
344
344
|
validate_outer_layers(traces, 'cassandra_test')
|
345
345
|
|
@@ -349,7 +349,7 @@ describe Oboe::Inst::Cassandra do
|
|
349
349
|
traces[1].has_key?('Backtrace').must_equal Oboe::Config[:cassandra][:collect_backtraces]
|
350
350
|
validate_event_keys(traces[2], @exit_kvs)
|
351
351
|
end
|
352
|
-
|
352
|
+
|
353
353
|
it "should obey :collect_backtraces setting when true" do
|
354
354
|
Oboe::Config[:cassandra][:collect_backtraces] = true
|
355
355
|
|
@@ -373,5 +373,5 @@ describe Oboe::Inst::Cassandra do
|
|
373
373
|
traces = get_all_traces
|
374
374
|
layer_doesnt_have_key(traces, 'cassandra', 'Backtrace')
|
375
375
|
end
|
376
|
-
|
376
|
+
|
377
377
|
end
|