traceview 3.5.0 → 3.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/lib/traceview/inst/bunny.rb +2 -0
- data/lib/traceview/inst/curb.rb +2 -0
- data/lib/traceview/inst/excon.rb +16 -2
- data/lib/traceview/inst/httpclient.rb +2 -0
- data/lib/traceview/inst/mongo.rb +16 -17
- data/lib/traceview/util.rb +43 -10
- data/lib/traceview/version.rb +1 -1
- data/test/instrumentation/curb_test.rb +2 -2
- data/test/instrumentation/excon_test.rb +72 -56
- data/test/instrumentation/httpclient_test.rb +2 -2
- data/test/instrumentation/rest-client_test.rb +2 -2
- data/test/instrumentation/sidekiq-worker_test.rb +2 -2
- data/test/queues/delayed_job-worker_test.rb +2 -2
- data/test/support/init_report_test.rb +25 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 86278e19d054dffabfc5f5734f2ee9dde2b2d199
|
4
|
+
data.tar.gz: 545d93bba409db72f8d6ddef5006d00a41430963
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 450ce8d0870dd1533f531850ccd2a362cb1b689e33b45405e7e0d9c55405ed5606070211642a459fd311d2112ff19cde65b45ea17dac0e2d822bd31aa7cad260
|
7
|
+
data.tar.gz: f6f47a46528799f165227a38a917322896d150dcb5263901a5ace00d2b9b7343e2830542f904f418efd81fbb6d0baad83737835cb90f9179989d7a805d98ba67
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,19 @@ https://github.com/appneta/oboe-ruby/releases
|
|
4
4
|
|
5
5
|
Dates in this file are in the format MM/DD/YYYY.
|
6
6
|
|
7
|
+
# traceview 3.5.1
|
8
|
+
|
9
|
+
This patch release includes the following fixes:
|
10
|
+
|
11
|
+
* Excon: hash query handling fix (thanks @tlunter!): #161, #163
|
12
|
+
* Data collection methods should ensure hash values are always returned: #162
|
13
|
+
* Expanded Init reporting: #159
|
14
|
+
|
15
|
+
Pushed to Rubygems:
|
16
|
+
|
17
|
+
https://rubygems.org/gems/traceview/versions/3.5.1
|
18
|
+
https://rubygems.org/gems/traceview/versions/3.5.1-java
|
19
|
+
|
7
20
|
# traceview 3.5.0
|
8
21
|
|
9
22
|
This minor release includes the following new feature:
|
data/lib/traceview/inst/bunny.rb
CHANGED
data/lib/traceview/inst/curb.rb
CHANGED
data/lib/traceview/inst/excon.rb
CHANGED
@@ -16,8 +16,20 @@ module TraceView
|
|
16
16
|
kvs['RemoteHost'] = @data[:host]
|
17
17
|
|
18
18
|
# Conditionally log query args
|
19
|
-
if TraceView::Config[:excon][:log_args] &&
|
20
|
-
|
19
|
+
if TraceView::Config[:excon][:log_args] && @data[:query]
|
20
|
+
if @data[:query].is_a?(Hash)
|
21
|
+
if RUBY_VERSION >= '1.9.2'
|
22
|
+
kvs['ServiceArg'] = "#{@data[:path]}?#{URI.encode_www_form(@data[:query])}"
|
23
|
+
else
|
24
|
+
# An imperfect solution for the lack of URI.encode_www_form for Ruby versions before
|
25
|
+
# 1.9.2. We manually create a query string for reporting purposes only.
|
26
|
+
query_arg = ""
|
27
|
+
@data[:query].each_pair { |k,v| query_arg += "#{k}=#{v}?"; }
|
28
|
+
kvs['ServiceArg'] = "#{@data[:path]}?#{query_arg.chop}"
|
29
|
+
end
|
30
|
+
else
|
31
|
+
kvs['ServiceArg'] = "#{@data[:path]}?#{@data[:query]}"
|
32
|
+
end
|
21
33
|
else
|
22
34
|
kvs['ServiceArg'] = @data[:path]
|
23
35
|
end
|
@@ -39,6 +51,8 @@ module TraceView
|
|
39
51
|
rescue => e
|
40
52
|
TraceView.logger.debug "[traceview/debug] Error capturing excon KVs: #{e.message}"
|
41
53
|
TraceView.logger.debug e.backtrace.join('\n') if ::TraceView::Config[:verbose]
|
54
|
+
ensure
|
55
|
+
return kvs
|
42
56
|
end
|
43
57
|
|
44
58
|
def requests_with_traceview(pipeline_params)
|
@@ -33,6 +33,8 @@ module TraceView
|
|
33
33
|
rescue => e
|
34
34
|
TraceView.logger.debug "[traceview/debug] Error capturing httpclient KVs: #{e.message}"
|
35
35
|
TraceView.logger.debug e.backtrace.join('\n') if ::TraceView::Config[:verbose]
|
36
|
+
ensure
|
37
|
+
return kvs
|
36
38
|
end
|
37
39
|
|
38
40
|
def do_request_with_traceview(method, uri, query, body, header, &block)
|
data/lib/traceview/inst/mongo.rb
CHANGED
@@ -120,23 +120,22 @@ if defined?(::Mongo) && TraceView::Config[:mongo][:enabled]
|
|
120
120
|
include TraceView::Inst::Mongo
|
121
121
|
|
122
122
|
def traceview_collect(m, args)
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
report_kvs
|
123
|
+
kvs = {}
|
124
|
+
kvs[:Flavor] = TraceView::Inst::Mongo::FLAVOR
|
125
|
+
|
126
|
+
kvs[:Database] = @db.name
|
127
|
+
kvs[:RemoteHost] = @db.connection.host
|
128
|
+
kvs[:RemotePort] = @db.connection.port
|
129
|
+
kvs[:Collection] = @name
|
130
|
+
|
131
|
+
kvs[:Backtrace] = TraceView::API.backtrace if TraceView::Config[:mongo][:collect_backtraces]
|
132
|
+
|
133
|
+
kvs[:QueryOp] = m
|
134
|
+
kvs[:Query] = args[0].to_json if args && !args.empty? && args[0].class == Hash
|
135
|
+
rescue StandardError => e
|
136
|
+
TraceView.logger.debug "[traceview/debug] Exception in traceview_collect KV collection: #{e.inspect}"
|
137
|
+
ensure
|
138
|
+
return kvs
|
140
139
|
end
|
141
140
|
|
142
141
|
# Instrument Collection write operations
|
data/lib/traceview/util.rb
CHANGED
@@ -171,23 +171,18 @@ module TraceView
|
|
171
171
|
end
|
172
172
|
|
173
173
|
##
|
174
|
-
#
|
174
|
+
# legacy_build_init_report
|
175
175
|
#
|
176
176
|
# Internal: Build a hash of KVs that reports on the status of the
|
177
177
|
# running environment. This is used on stack boot in __Init reporting
|
178
178
|
# and for TraceView.support_report.
|
179
179
|
#
|
180
|
-
|
181
|
-
|
180
|
+
# This legacy version of build_init_report is used for apps without Bundler.
|
181
|
+
#
|
182
|
+
def legacy_build_init_report
|
183
|
+
platform_info = {}
|
182
184
|
|
183
185
|
begin
|
184
|
-
platform_info['Force'] = true
|
185
|
-
platform_info['Ruby.Platform.Version'] = RUBY_PLATFORM
|
186
|
-
platform_info['Ruby.Version'] = RUBY_VERSION
|
187
|
-
platform_info['Ruby.TraceView.Version'] = ::TraceView::Version::STRING
|
188
|
-
platform_info['RubyHeroku.TraceView.Version'] = ::TraceViewHeroku::Version::STRING if defined?(::TraceViewHeroku)
|
189
|
-
platform_info['Ruby.TraceMode.Version'] = ::TraceView::Config[:tracing_mode]
|
190
|
-
|
191
186
|
# Report the framework in use
|
192
187
|
if defined?(::RailsLts::VERSION)
|
193
188
|
platform_info['Ruby.RailsLts.Version'] = "RailsLts-#{::RailsLts::VERSION}"
|
@@ -235,6 +230,44 @@ module TraceView
|
|
235
230
|
platform_info['Ruby.PG.Version'] = PG::VERSION if defined?(PG::VERSION)
|
236
231
|
platform_info['Ruby.Mysql2.Version'] = Mysql2::VERSION if defined?(Mysql2::VERSION)
|
237
232
|
platform_info['Ruby.Sequel.Version'] = ::Sequel::VERSION if defined?(::Sequel::VERSION)
|
233
|
+
rescue StandardError, ScriptError => e
|
234
|
+
# Also rescue ScriptError (aka SyntaxError) in case one of the expected
|
235
|
+
# version defines don't exist
|
236
|
+
|
237
|
+
platform_info['Error'] = "Error in legacy_build_init_report: #{e.message}"
|
238
|
+
|
239
|
+
TraceView.logger.warn "[traceview/warn] Error in legacy_build_init_report: #{e.message}"
|
240
|
+
TraceView.logger.debug e.backtrace
|
241
|
+
end
|
242
|
+
platform_info
|
243
|
+
end
|
244
|
+
|
245
|
+
##
|
246
|
+
# build_init_report
|
247
|
+
#
|
248
|
+
# Internal: Build a hash of KVs that reports on the status of the
|
249
|
+
# running environment. This is used on stack boot in __Init reporting
|
250
|
+
# and for TraceView.support_report.
|
251
|
+
#
|
252
|
+
def build_init_report
|
253
|
+
platform_info = { '__Init' => 1 }
|
254
|
+
|
255
|
+
begin
|
256
|
+
platform_info['Force'] = true
|
257
|
+
platform_info['Ruby.Platform.Version'] = RUBY_PLATFORM
|
258
|
+
platform_info['Ruby.Version'] = RUBY_VERSION
|
259
|
+
platform_info['Ruby.TraceView.Version'] = ::TraceView::Version::STRING
|
260
|
+
platform_info['RubyHeroku.TraceView.Version'] = ::TraceViewHeroku::Version::STRING if defined?(::TraceViewHeroku)
|
261
|
+
platform_info['Ruby.TraceMode.Version'] = ::TraceView::Config[:tracing_mode]
|
262
|
+
|
263
|
+
# Collect up the loaded gems
|
264
|
+
if defined?(Gem) && Gem.respond_to?(:loaded_specs)
|
265
|
+
Gem.loaded_specs.each_pair { |k, v|
|
266
|
+
platform_info["Ruby.#{k}.Version"] = v.version.to_s
|
267
|
+
}
|
268
|
+
else
|
269
|
+
platform_info.merge!(legacy_build_init_report)
|
270
|
+
end
|
238
271
|
|
239
272
|
# Report the server in use (if possible)
|
240
273
|
if defined?(::Unicorn::Const::UNICORN_VERSION)
|
data/lib/traceview/version.rb
CHANGED
@@ -35,8 +35,8 @@ if RUBY_VERSION > '1.8.7' && !defined?(JRUBY_VERSION)
|
|
35
35
|
|
36
36
|
def test_reports_version_init
|
37
37
|
init_kvs = ::TraceView::Util.build_init_report
|
38
|
-
assert init_kvs.key?('Ruby.
|
39
|
-
assert_equal init_kvs['Ruby.
|
38
|
+
assert init_kvs.key?('Ruby.curb.Version')
|
39
|
+
assert_equal ::Curl::CURB_VERSION, init_kvs['Ruby.curb.Version']
|
40
40
|
end
|
41
41
|
|
42
42
|
def test_class_get_request
|
@@ -22,8 +22,7 @@ class ExconTest < Minitest::Test
|
|
22
22
|
|
23
23
|
def test_reports_version_init
|
24
24
|
init_kvs = ::TraceView::Util.build_init_report
|
25
|
-
|
26
|
-
assert_equal init_kvs['Ruby.Excon.Version'], "Excon-#{::Excon::VERSION}"
|
25
|
+
assert_equal ::Excon::VERSION, init_kvs['Ruby.excon.Version']
|
27
26
|
end
|
28
27
|
|
29
28
|
def test_class_get_request
|
@@ -38,16 +37,16 @@ class ExconTest < Minitest::Test
|
|
38
37
|
validate_outer_layers(traces, "excon_tests")
|
39
38
|
valid_edges?(traces)
|
40
39
|
|
41
|
-
assert_equal traces[1]['IsService']
|
42
|
-
assert_equal traces[1]['RemoteHost']
|
43
|
-
assert_equal traces[1]['RemoteProtocol']
|
44
|
-
assert_equal traces[1]['ServiceArg']
|
45
|
-
assert_equal traces[1]['HTTPMethod']
|
40
|
+
assert_equal 1, traces[1]['IsService']
|
41
|
+
assert_equal '127.0.0.1', traces[1]['RemoteHost']
|
42
|
+
assert_equal 'HTTP', traces[1]['RemoteProtocol']
|
43
|
+
assert_equal '/', traces[1]['ServiceArg']
|
44
|
+
assert_equal 'GET', traces[1]['HTTPMethod']
|
46
45
|
assert traces[1].key?('Backtrace')
|
47
46
|
|
48
|
-
assert_equal traces[5]['Layer']
|
49
|
-
assert_equal traces[5]['Label']
|
50
|
-
assert_equal traces[5]['HTTPStatus']
|
47
|
+
assert_equal 'excon', traces[5]['Layer']
|
48
|
+
assert_equal 'exit', traces[5]['Label']
|
49
|
+
assert_equal 200, traces[5]['HTTPStatus']
|
51
50
|
end
|
52
51
|
|
53
52
|
def test_cross_app_tracing
|
@@ -65,17 +64,17 @@ class ExconTest < Minitest::Test
|
|
65
64
|
end
|
66
65
|
|
67
66
|
traces = get_all_traces
|
68
|
-
assert_equal traces.count
|
67
|
+
assert_equal 7, traces.count
|
69
68
|
validate_outer_layers(traces, "excon_tests")
|
70
69
|
valid_edges?(traces)
|
71
70
|
|
72
|
-
assert_equal traces[1]['IsService']
|
73
|
-
assert_equal traces[1]['RemoteHost']
|
74
|
-
assert_equal traces[1]['RemoteProtocol']
|
75
|
-
assert_equal traces[1]['ServiceArg']
|
76
|
-
assert_equal traces[1]['HTTPMethod']
|
71
|
+
assert_equal 1, traces[1]['IsService']
|
72
|
+
assert_equal '127.0.0.1', traces[1]['RemoteHost']
|
73
|
+
assert_equal 'HTTP', traces[1]['RemoteProtocol']
|
74
|
+
assert_equal '/?blah=1', traces[1]['ServiceArg']
|
75
|
+
assert_equal 'GET', traces[1]['HTTPMethod']
|
76
|
+
assert_equal 200, traces[5]['HTTPStatus']
|
77
77
|
assert traces[1].key?('Backtrace')
|
78
|
-
assert_equal traces[5]['HTTPStatus'], 200
|
79
78
|
end
|
80
79
|
|
81
80
|
def test_persistent_requests
|
@@ -96,29 +95,29 @@ class ExconTest < Minitest::Test
|
|
96
95
|
validate_outer_layers(traces, "excon_tests")
|
97
96
|
valid_edges?(traces)
|
98
97
|
|
99
|
-
assert_equal traces[1]['IsService']
|
100
|
-
assert_equal traces[1]['RemoteHost']
|
101
|
-
assert_equal traces[1]['RemoteProtocol']
|
102
|
-
assert_equal traces[1]['ServiceArg']
|
103
|
-
assert_equal traces[1]['HTTPMethod']
|
98
|
+
assert_equal 1, traces[1]['IsService']
|
99
|
+
assert_equal '127.0.0.1', traces[1]['RemoteHost']
|
100
|
+
assert_equal 'HTTP', traces[1]['RemoteProtocol']
|
101
|
+
assert_equal '/', traces[1]['ServiceArg']
|
102
|
+
assert_equal 'GET', traces[1]['HTTPMethod']
|
103
|
+
assert_equal 200, traces[5]['HTTPStatus']
|
104
104
|
assert traces[1].key?('Backtrace')
|
105
|
-
assert_equal traces[5]['HTTPStatus'], 200
|
106
105
|
|
107
|
-
assert_equal traces[6]['IsService']
|
108
|
-
assert_equal traces[6]['RemoteHost']
|
109
|
-
assert_equal traces[6]['RemoteProtocol']
|
110
|
-
assert_equal traces[6]['ServiceArg']
|
111
|
-
assert_equal traces[6]['HTTPMethod']
|
106
|
+
assert_equal 1, traces[6]['IsService']
|
107
|
+
assert_equal '127.0.0.1', traces[6]['RemoteHost']
|
108
|
+
assert_equal 'HTTP', traces[6]['RemoteProtocol']
|
109
|
+
assert_equal '/', traces[6]['ServiceArg']
|
110
|
+
assert_equal 'GET', traces[6]['HTTPMethod']
|
111
|
+
assert_equal 200, traces[10]['HTTPStatus']
|
112
112
|
assert traces[6].key?('Backtrace')
|
113
|
-
assert_equal traces[10]['HTTPStatus'], 200
|
114
113
|
|
115
|
-
assert_equal traces[11]['IsService']
|
116
|
-
assert_equal traces[11]['RemoteHost']
|
117
|
-
assert_equal traces[11]['RemoteProtocol']
|
118
|
-
assert_equal traces[11]['ServiceArg']
|
119
|
-
assert_equal traces[11]['HTTPMethod']
|
114
|
+
assert_equal 1, traces[11]['IsService']
|
115
|
+
assert_equal '127.0.0.1', traces[11]['RemoteHost']
|
116
|
+
assert_equal 'HTTP', traces[11]['RemoteProtocol']
|
117
|
+
assert_equal '/', traces[11]['ServiceArg']
|
118
|
+
assert_equal 'GET', traces[11]['HTTPMethod']
|
119
|
+
assert_equal 200, traces[15]['HTTPStatus']
|
120
120
|
assert traces[11].key?('Backtrace')
|
121
|
-
assert_equal traces[15]['HTTPStatus'], 200
|
122
121
|
end
|
123
122
|
|
124
123
|
def test_pipelined_requests
|
@@ -132,16 +131,16 @@ class ExconTest < Minitest::Test
|
|
132
131
|
end
|
133
132
|
|
134
133
|
traces = get_all_traces
|
135
|
-
assert_equal traces.count
|
134
|
+
assert_equal 10, traces.count
|
136
135
|
validate_outer_layers(traces, "excon_tests")
|
137
136
|
valid_edges?(traces)
|
138
137
|
|
139
|
-
assert_equal traces[1]['IsService']
|
140
|
-
assert_equal traces[1]['RemoteHost']
|
141
|
-
assert_equal traces[1]['RemoteProtocol']
|
142
|
-
assert_equal traces[1]['ServiceArg']
|
143
|
-
assert_equal traces[1]['Pipeline']
|
144
|
-
assert_equal traces[1]['HTTPMethods']
|
138
|
+
assert_equal 1, traces[1]['IsService']
|
139
|
+
assert_equal '127.0.0.1', traces[1]['RemoteHost']
|
140
|
+
assert_equal 'HTTP', traces[1]['RemoteProtocol']
|
141
|
+
assert_equal '/', traces[1]['ServiceArg']
|
142
|
+
assert_equal 'true', traces[1]['Pipeline']
|
143
|
+
assert_equal 'GET, PUT', traces[1]['HTTPMethods']
|
145
144
|
assert traces[1].key?('Backtrace')
|
146
145
|
end
|
147
146
|
|
@@ -160,21 +159,21 @@ class ExconTest < Minitest::Test
|
|
160
159
|
validate_outer_layers(traces, "excon_tests")
|
161
160
|
valid_edges?(traces)
|
162
161
|
|
163
|
-
assert_equal traces[1]['IsService']
|
164
|
-
assert_equal traces[1]['RemoteHost']
|
165
|
-
assert_equal traces[1]['RemoteProtocol']
|
166
|
-
assert_equal traces[1]['ServiceArg']
|
167
|
-
assert_equal traces[1]['HTTPMethod']
|
162
|
+
assert_equal 1, traces[1]['IsService']
|
163
|
+
assert_equal 'asfjalkfjlajfljkaljf', traces[1]['RemoteHost']
|
164
|
+
assert_equal 'HTTP', traces[1]['RemoteProtocol']
|
165
|
+
assert_equal '/', traces[1]['ServiceArg']
|
166
|
+
assert_equal 'GET', traces[1]['HTTPMethod']
|
168
167
|
assert traces[1].key?('Backtrace')
|
169
168
|
|
170
|
-
assert_equal traces[2]['Layer']
|
171
|
-
assert_equal traces[2]['Label']
|
172
|
-
assert_equal traces[2]['ErrorClass']
|
169
|
+
assert_equal 'excon', traces[2]['Layer']
|
170
|
+
assert_equal 'error', traces[2]['Label']
|
171
|
+
assert_equal "Excon::Errors::SocketError", traces[2]['ErrorClass']
|
173
172
|
assert traces[2].key?('ErrorMsg')
|
174
173
|
assert traces[2].key?('Backtrace')
|
175
174
|
|
176
|
-
assert_equal traces[3]['Layer']
|
177
|
-
assert_equal traces[3]['Label']
|
175
|
+
assert_equal 'excon', traces[3]['Layer']
|
176
|
+
assert_equal 'exit', traces[3]['Label']
|
178
177
|
end
|
179
178
|
|
180
179
|
def test_obey_log_args_when_false
|
@@ -188,8 +187,8 @@ class ExconTest < Minitest::Test
|
|
188
187
|
end
|
189
188
|
|
190
189
|
traces = get_all_traces
|
191
|
-
assert_equal traces.count
|
192
|
-
assert_equal traces[1]['ServiceArg']
|
190
|
+
assert_equal 7, traces.count
|
191
|
+
assert_equal '/', traces[1]['ServiceArg']
|
193
192
|
|
194
193
|
TraceView::Config[:excon][:log_args] = @log_args
|
195
194
|
end
|
@@ -205,8 +204,25 @@ class ExconTest < Minitest::Test
|
|
205
204
|
end
|
206
205
|
|
207
206
|
traces = get_all_traces
|
208
|
-
assert_equal traces.count
|
209
|
-
assert_equal traces[1]['ServiceArg']
|
207
|
+
assert_equal 7, traces.count
|
208
|
+
assert_equal '/?blah=1', traces[1]['ServiceArg']
|
209
|
+
|
210
|
+
TraceView::Config[:excon][:log_args] = @log_args
|
211
|
+
end
|
212
|
+
|
213
|
+
def test_obey_log_args_when_true_and_using_hash
|
214
|
+
@log_args = TraceView::Config[:excon][:log_args]
|
215
|
+
clear_all_traces
|
216
|
+
|
217
|
+
TraceView::Config[:excon][:log_args] = true
|
218
|
+
|
219
|
+
TraceView::API.start_trace('excon_tests') do
|
220
|
+
Excon.get('http://127.0.0.1:8101/?', :query => { :blah => 1 })
|
221
|
+
end
|
222
|
+
|
223
|
+
traces = get_all_traces
|
224
|
+
assert_equal 7, traces.count
|
225
|
+
assert_equal '/?blah=1', traces[1]['ServiceArg']
|
210
226
|
|
211
227
|
TraceView::Config[:excon][:log_args] = @log_args
|
212
228
|
end
|
@@ -15,8 +15,8 @@ unless defined?(JRUBY_VERSION)
|
|
15
15
|
|
16
16
|
def test_reports_version_init
|
17
17
|
init_kvs = ::TraceView::Util.build_init_report
|
18
|
-
assert init_kvs.key?('Ruby.
|
19
|
-
assert_equal init_kvs['Ruby.
|
18
|
+
assert init_kvs.key?('Ruby.httpclient.Version')
|
19
|
+
assert_equal ::HTTPClient::VERSION, init_kvs['Ruby.httpclient.Version']
|
20
20
|
end
|
21
21
|
|
22
22
|
def test_get_request
|
@@ -27,8 +27,8 @@ if RUBY_VERSION >= '1.9.3'
|
|
27
27
|
it "should report rest-client version in __Init" do
|
28
28
|
init_kvs = ::TraceView::Util.build_init_report
|
29
29
|
|
30
|
-
init_kvs.key?('Ruby.
|
31
|
-
init_kvs['Ruby.
|
30
|
+
init_kvs.key?('Ruby.rest-client.Version').must_equal true
|
31
|
+
init_kvs['Ruby.rest-client.Version'].must_equal ::RestClient::VERSION
|
32
32
|
end
|
33
33
|
|
34
34
|
it "should trace a request to an instr'd app" do
|
@@ -22,8 +22,8 @@ if RUBY_VERSION >= '2.0' && !defined?(JRUBY_VERSION)
|
|
22
22
|
|
23
23
|
def test_reports_version_init
|
24
24
|
init_kvs = ::TraceView::Util.build_init_report
|
25
|
-
assert init_kvs.key?('Ruby.
|
26
|
-
assert_equal
|
25
|
+
assert init_kvs.key?('Ruby.sidekiq.Version')
|
26
|
+
assert_equal ::Sidekiq::VERSION, init_kvs['Ruby.sidekiq.Version']
|
27
27
|
end
|
28
28
|
|
29
29
|
def test_job_run
|
@@ -24,8 +24,8 @@ class DelayedJobWorkerTest < Minitest::Test
|
|
24
24
|
|
25
25
|
def test_reports_version_init
|
26
26
|
init_kvs = ::TraceView::Util.build_init_report
|
27
|
-
assert init_kvs.key?('Ruby.
|
28
|
-
assert_equal
|
27
|
+
assert init_kvs.key?('Ruby.delayed_job.Version')
|
28
|
+
assert_equal Gem.loaded_specs['delayed_job'].version.to_s, init_kvs['Ruby.delayed_job.Version']
|
29
29
|
end
|
30
30
|
|
31
31
|
def test_job_run
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# Copyright (c) 2015 AppNeta, Inc.
|
2
|
+
# All rights reserved.
|
3
|
+
|
4
|
+
require 'minitest_helper'
|
5
|
+
|
6
|
+
class InitReportTest < Minitest::Test
|
7
|
+
def test_report_format
|
8
|
+
init_kvs = ::TraceView::Util.build_init_report
|
9
|
+
init_kvs.is_a?(Hash)
|
10
|
+
end
|
11
|
+
|
12
|
+
def test_report_kvs
|
13
|
+
init_kvs = ::TraceView::Util.build_init_report
|
14
|
+
init_kvs.has_key?("__Init").must_equal true
|
15
|
+
init_kvs.has_key?("Force").must_equal true
|
16
|
+
init_kvs.has_key?("Ruby.AppContainer.Version").must_equal true
|
17
|
+
init_kvs["Ruby.TraceView.Version"].must_equal TraceView::Version::STRING
|
18
|
+
init_kvs["Ruby.TraceMode.Version"].must_equal TraceView::Config[:tracing_mode]
|
19
|
+
end
|
20
|
+
|
21
|
+
def test_legacy_report_format
|
22
|
+
init_kvs = ::TraceView::Util.legacy_build_init_report
|
23
|
+
init_kvs.is_a?(Hash)
|
24
|
+
end
|
25
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: traceview
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.5.
|
4
|
+
version: 3.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Giacomo Lombardo
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-02-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json
|
@@ -264,6 +264,7 @@ files:
|
|
264
264
|
- test/support/backcompat_test.rb
|
265
265
|
- test/support/config_test.rb
|
266
266
|
- test/support/dnt_test.rb
|
267
|
+
- test/support/init_report_test.rb
|
267
268
|
- test/support/liboboe_settings_test.rb
|
268
269
|
- test/support/noop_test.rb
|
269
270
|
- test/support/sql_sanitize_test.rb
|
@@ -345,6 +346,7 @@ test_files:
|
|
345
346
|
- test/frameworks/rails4x_test.rb
|
346
347
|
- test/queues/delayed_job-worker_test.rb
|
347
348
|
- test/queues/delayed_job-client_test.rb
|
349
|
+
- test/support/init_report_test.rb
|
348
350
|
- test/support/config_test.rb
|
349
351
|
- test/support/noop_test.rb
|
350
352
|
- test/support/dnt_test.rb
|