traceview 3.0.2-java → 3.0.3-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +39 -14
- data/Gemfile +4 -62
- data/Rakefile +23 -8
- data/gemfiles/frameworks.gemfile +40 -0
- data/gemfiles/libraries.gemfile +78 -0
- data/gemfiles/rails23.gemfile +47 -0
- data/gemfiles/rails30.gemfile +47 -0
- data/gemfiles/rails31.gemfile +47 -0
- data/gemfiles/rails32.gemfile +47 -0
- data/gemfiles/rails40.gemfile +35 -0
- data/gemfiles/rails41.gemfile +35 -0
- data/gemfiles/rails42.gemfile +35 -0
- data/lib/traceview/api/logging.rb +84 -38
- data/lib/traceview/frameworks/rails/inst/action_controller.rb +1 -1
- data/lib/traceview/inst/moped.rb +2 -2
- data/lib/traceview/util.rb +30 -34
- data/lib/traceview/version.rb +1 -1
- data/test/frameworks/apps/grape_nested.rb +3 -0
- data/test/frameworks/apps/grape_simple.rb +3 -0
- data/test/frameworks/apps/sinatra_simple.rb +3 -0
- data/test/frameworks/grape_test.rb +8 -4
- data/test/frameworks/padrino_test.rb +6 -2
- data/test/frameworks/rails2x_test.rb +3 -0
- data/test/frameworks/rails3x_test.rb +91 -0
- data/test/frameworks/rails4x_test.rb +89 -0
- data/test/frameworks/sinatra_test.rb +3 -0
- data/test/instrumentation/cassandra_test.rb +11 -4
- data/test/instrumentation/dalli_test.rb +3 -0
- data/test/instrumentation/em_http_request_test.rb +3 -0
- data/test/instrumentation/excon_test.rb +3 -0
- data/test/instrumentation/faraday_test.rb +3 -0
- data/test/instrumentation/http_test.rb +3 -0
- data/test/instrumentation/httpclient_test.rb +3 -0
- data/test/instrumentation/memcache_test.rb +9 -0
- data/test/instrumentation/memcached_test.rb +3 -0
- data/test/instrumentation/mongo_test.rb +14 -3
- data/test/instrumentation/moped_test.rb +29 -6
- data/test/instrumentation/rack_test.rb +3 -0
- data/test/instrumentation/redis_hashes_test.rb +187 -184
- data/test/instrumentation/redis_keys_test.rb +223 -220
- data/test/instrumentation/redis_lists_test.rb +225 -225
- data/test/instrumentation/redis_misc_test.rb +123 -120
- data/test/instrumentation/redis_sets_test.rb +216 -213
- data/test/instrumentation/redis_sortedsets_test.rb +245 -242
- data/test/instrumentation/redis_strings_test.rb +242 -238
- data/test/instrumentation/resque_test.rb +3 -0
- data/test/instrumentation/rest-client_test.rb +3 -0
- data/test/instrumentation/sequel_mysql2_test.rb +4 -1
- data/test/instrumentation/sequel_mysql_test.rb +4 -1
- data/test/instrumentation/sequel_pg_test.rb +4 -1
- data/test/minitest_helper.rb +25 -8
- data/test/profiling/method_test.rb +3 -0
- data/test/servers/rackapp_8101.rb +1 -1
- data/test/servers/rails2x_8140.rb +2 -2
- data/test/servers/rails3x_8140.rb +78 -0
- data/test/servers/rails4x_8140.rb +78 -0
- data/test/support/backcompat_test.rb +3 -0
- data/test/support/config_test.rb +3 -0
- data/test/support/dnt_test.rb +3 -0
- data/test/support/liboboe_settings_test.rb +3 -0
- data/test/support/tvalias_test.rb +3 -0
- data/test/support/xtrace_test.rb +3 -0
- metadata +19 -5
- data/Appraisals +0 -10
- data/gemfiles/mongo.gemfile +0 -33
- data/gemfiles/moped.gemfile +0 -33
@@ -0,0 +1,47 @@
|
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
if RUBY_VERSION < '1.9.3'
|
4
|
+
# i18n 0.7.0 dropped support for Ruby 1.9.2 and older. ActiveSupport
|
5
|
+
# depends on i18n 0.7.0 since v 4.0.5. For < 1.9.2 Ruby support, lock
|
6
|
+
# down to these versions to maintain functionality.
|
7
|
+
gem 'i18n', '< 0.7.0'
|
8
|
+
gem 'activesupport', '< 4.0'
|
9
|
+
end
|
10
|
+
|
11
|
+
group :development, :test do
|
12
|
+
gem 'rake'
|
13
|
+
gem 'minitest'
|
14
|
+
gem 'minitest-reporters'
|
15
|
+
gem 'minitest-debugger', :require => false
|
16
|
+
gem 'rack-test'
|
17
|
+
gem 'puma'
|
18
|
+
if RUBY_VERSION < '1.9.3'
|
19
|
+
gem 'bson', '<= 1.12.3'
|
20
|
+
else
|
21
|
+
gem 'bson'
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
group :development do
|
26
|
+
gem 'ruby-debug', :platforms => [ :mri_18, :jruby ]
|
27
|
+
gem 'debugger', :platform => :mri_19
|
28
|
+
gem 'byebug', :platforms => [ :mri_20, :mri_21, :mri_22 ]
|
29
|
+
# gem 'perftools.rb', :platforms => [ :mri_20, :mri_21 ], :require => 'perftools'
|
30
|
+
if RUBY_VERSION > '1.8.7'
|
31
|
+
gem 'pry'
|
32
|
+
gem 'pry-byebug', :platforms => [ :mri_20, :mri_21, :mri_22 ]
|
33
|
+
else
|
34
|
+
gem 'pry', '0.9.12.4'
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
if defined?(JRUBY_VERSION)
|
39
|
+
gem 'sinatra', :require => false
|
40
|
+
else
|
41
|
+
gem 'sinatra'
|
42
|
+
end
|
43
|
+
|
44
|
+
gem "rails", "~>3.2"
|
45
|
+
|
46
|
+
gemspec :path => File.expand_path(File.dirname(__FILE__) + '/../')
|
47
|
+
# vim:syntax=ruby
|
@@ -0,0 +1,35 @@
|
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
group :development, :test do
|
4
|
+
gem 'rake'
|
5
|
+
gem 'minitest'
|
6
|
+
gem 'minitest-reporters'
|
7
|
+
gem 'minitest-debugger', :require => false
|
8
|
+
gem 'rack-test'
|
9
|
+
gem 'puma'
|
10
|
+
gem 'bson'
|
11
|
+
end
|
12
|
+
|
13
|
+
group :development do
|
14
|
+
gem 'ruby-debug', :platforms => [ :mri_18, :jruby ]
|
15
|
+
gem 'debugger', :platform => :mri_19
|
16
|
+
gem 'byebug', :platforms => [ :mri_20, :mri_21, :mri_22 ]
|
17
|
+
# gem 'perftools.rb', :platforms => [ :mri_20, :mri_21 ], :require => 'perftools'
|
18
|
+
if RUBY_VERSION > '1.8.7'
|
19
|
+
gem 'pry'
|
20
|
+
gem 'pry-byebug', :platforms => [ :mri_20, :mri_21, :mri_22 ]
|
21
|
+
else
|
22
|
+
gem 'pry', '0.9.12.4'
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
if defined?(JRUBY_VERSION)
|
27
|
+
gem 'sinatra', :require => false
|
28
|
+
else
|
29
|
+
gem 'sinatra'
|
30
|
+
end
|
31
|
+
|
32
|
+
gem "rails", "~>4.0"
|
33
|
+
|
34
|
+
gemspec :path => File.expand_path(File.dirname(__FILE__) + '/../')
|
35
|
+
# vim:syntax=ruby
|
@@ -0,0 +1,35 @@
|
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
group :development, :test do
|
4
|
+
gem 'rake'
|
5
|
+
gem 'minitest'
|
6
|
+
gem 'minitest-reporters'
|
7
|
+
gem 'minitest-debugger', :require => false
|
8
|
+
gem 'rack-test'
|
9
|
+
gem 'puma'
|
10
|
+
gem 'bson'
|
11
|
+
end
|
12
|
+
|
13
|
+
group :development do
|
14
|
+
gem 'ruby-debug', :platforms => [ :mri_18, :jruby ]
|
15
|
+
gem 'debugger', :platform => :mri_19
|
16
|
+
gem 'byebug', :platforms => [ :mri_20, :mri_21, :mri_22 ]
|
17
|
+
# gem 'perftools.rb', :platforms => [ :mri_20, :mri_21 ], :require => 'perftools'
|
18
|
+
if RUBY_VERSION > '1.8.7'
|
19
|
+
gem 'pry'
|
20
|
+
gem 'pry-byebug', :platforms => [ :mri_20, :mri_21, :mri_22 ]
|
21
|
+
else
|
22
|
+
gem 'pry', '0.9.12.4'
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
if defined?(JRUBY_VERSION)
|
27
|
+
gem 'sinatra', :require => false
|
28
|
+
else
|
29
|
+
gem 'sinatra'
|
30
|
+
end
|
31
|
+
|
32
|
+
gem "rails", "~>4.1"
|
33
|
+
|
34
|
+
gemspec :path => File.expand_path(File.dirname(__FILE__) + '/../')
|
35
|
+
# vim:syntax=ruby
|
@@ -0,0 +1,35 @@
|
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
group :development, :test do
|
4
|
+
gem 'rake'
|
5
|
+
gem 'minitest'
|
6
|
+
gem 'minitest-reporters'
|
7
|
+
gem 'minitest-debugger', :require => false
|
8
|
+
gem 'rack-test'
|
9
|
+
gem 'puma'
|
10
|
+
gem 'bson'
|
11
|
+
end
|
12
|
+
|
13
|
+
group :development do
|
14
|
+
gem 'ruby-debug', :platforms => [ :mri_18, :jruby ]
|
15
|
+
gem 'debugger', :platform => :mri_19
|
16
|
+
gem 'byebug', :platforms => [ :mri_20, :mri_21, :mri_22 ]
|
17
|
+
# gem 'perftools.rb', :platforms => [ :mri_20, :mri_21 ], :require => 'perftools'
|
18
|
+
if RUBY_VERSION > '1.8.7'
|
19
|
+
gem 'pry'
|
20
|
+
gem 'pry-byebug', :platforms => [ :mri_20, :mri_21, :mri_22 ]
|
21
|
+
else
|
22
|
+
gem 'pry', '0.9.12.4'
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
if defined?(JRUBY_VERSION)
|
27
|
+
gem 'sinatra', :require => false
|
28
|
+
else
|
29
|
+
gem 'sinatra'
|
30
|
+
end
|
31
|
+
|
32
|
+
gem "rails", "~>4.2"
|
33
|
+
|
34
|
+
gemspec :path => File.expand_path(File.dirname(__FILE__) + '/../')
|
35
|
+
# vim:syntax=ruby
|
@@ -5,20 +5,22 @@ module TraceView
|
|
5
5
|
module API
|
6
6
|
##
|
7
7
|
# This modules provides the X-Trace logging facilities.
|
8
|
+
#
|
8
9
|
module Logging
|
10
|
+
##
|
9
11
|
# Public: Report an event in an active trace.
|
10
12
|
#
|
11
|
-
#
|
12
|
-
#
|
13
|
-
#
|
14
|
-
#
|
15
|
-
#
|
13
|
+
# ==== Arguments
|
14
|
+
#
|
15
|
+
# * +layer+ - The layer the reported event belongs to
|
16
|
+
# * +label+ - The label for the reported event. See API documentation for reserved labels and usage.
|
17
|
+
# * +opts+ - A hash containing key/value pairs that will be reported along with this event (optional).
|
16
18
|
#
|
17
|
-
# Example
|
19
|
+
# ==== Example
|
18
20
|
#
|
19
|
-
# log('logical_layer', 'entry')
|
20
|
-
# log('logical_layer', 'info', { :list_length => 20 })
|
21
|
-
# log('logical_layer', 'exit')
|
21
|
+
# TraceView::API.log('logical_layer', 'entry')
|
22
|
+
# TraceView::API.log('logical_layer', 'info', { :list_length => 20 })
|
23
|
+
# TraceView::API.log('logical_layer', 'exit')
|
22
24
|
#
|
23
25
|
# Returns nothing.
|
24
26
|
def log(layer, label, opts = {})
|
@@ -27,17 +29,20 @@ module TraceView
|
|
27
29
|
end
|
28
30
|
end
|
29
31
|
|
32
|
+
##
|
30
33
|
# Public: Report an exception.
|
31
34
|
#
|
32
|
-
#
|
33
|
-
#
|
35
|
+
# ==== Arguments
|
36
|
+
#
|
37
|
+
# * +layer+ - The layer the reported event belongs to
|
38
|
+
# * +exn+ - The exception to report
|
34
39
|
#
|
35
|
-
# Example
|
40
|
+
# ==== Example
|
36
41
|
#
|
37
42
|
# begin
|
38
|
-
#
|
43
|
+
# my_iffy_method
|
39
44
|
# rescue Exception => e
|
40
|
-
# log_exception('rails', e)
|
45
|
+
# TraceView::API.log_exception('rails', e)
|
41
46
|
# raise
|
42
47
|
# end
|
43
48
|
#
|
@@ -53,15 +58,20 @@ module TraceView
|
|
53
58
|
log(layer, 'error', kvs)
|
54
59
|
end
|
55
60
|
|
61
|
+
##
|
56
62
|
# Public: Decide whether or not to start a trace, and report an event
|
57
63
|
# appropriately.
|
58
64
|
#
|
59
|
-
#
|
60
|
-
#
|
61
|
-
#
|
62
|
-
#
|
65
|
+
# ==== Attributes
|
66
|
+
#
|
67
|
+
# * +layer+ - The layer the reported event belongs to
|
68
|
+
# * +xtrace+ - An xtrace metadata string, or nil. Used for cross-application tracing.
|
69
|
+
# * +opts+ - A hash containing key/value pairs that will be reported along with this event (optional).
|
70
|
+
#
|
71
|
+
# ==== Example
|
72
|
+
#
|
73
|
+
# Oboe::API.log_start(:layer_name, nil, { :id => @user.id })
|
63
74
|
#
|
64
|
-
# Returns nothing.
|
65
75
|
def log_start(layer, xtrace = nil, opts = {})
|
66
76
|
return if !TraceView.loaded || TraceView.never? ||
|
67
77
|
(opts.key?(:URL) && ::TraceView::Util.static_asset?(opts[:URL]))
|
@@ -100,9 +110,17 @@ module TraceView
|
|
100
110
|
end
|
101
111
|
end
|
102
112
|
|
103
|
-
|
113
|
+
##
|
114
|
+
# Public: Report an exit event and potentially clear the tracing context.
|
115
|
+
#
|
116
|
+
# ==== Attributes
|
117
|
+
#
|
118
|
+
# * +layer+ - The layer the reported event belongs to
|
119
|
+
# * +opts+ - A hash containing key/value pairs that will be reported along with this event (optional).
|
104
120
|
#
|
105
|
-
#
|
121
|
+
# ==== Example
|
122
|
+
#
|
123
|
+
# Oboe::API.log_end(:layer_name, { :id => @user.id })
|
106
124
|
#
|
107
125
|
# Returns an xtrace metadata string
|
108
126
|
def log_end(layer, opts = {})
|
@@ -117,8 +135,17 @@ module TraceView
|
|
117
135
|
##
|
118
136
|
# Public: Log an entry event
|
119
137
|
#
|
120
|
-
# A helper method to create and log an
|
121
|
-
#
|
138
|
+
# A helper method to create and log an entry event
|
139
|
+
#
|
140
|
+
# ==== Attributes
|
141
|
+
#
|
142
|
+
# * +layer+ - The layer the reported event belongs to
|
143
|
+
# * +kvs+ - A hash containing key/value pairs that will be reported along with this event (optional).
|
144
|
+
# * +op+ - To identify the current operation being traced. Used to avoid double tracing recursive calls.
|
145
|
+
#
|
146
|
+
# ==== Example
|
147
|
+
#
|
148
|
+
# Oboe::API.log_entry(:layer_name, { :id => @user.id })
|
122
149
|
#
|
123
150
|
# Returns an xtrace metadata string
|
124
151
|
def log_entry(layer, kvs = {}, op = nil)
|
@@ -131,8 +158,16 @@ module TraceView
|
|
131
158
|
##
|
132
159
|
# Public: Log an info event
|
133
160
|
#
|
134
|
-
# A helper method to create and log an
|
135
|
-
#
|
161
|
+
# A helper method to create and log an info event
|
162
|
+
#
|
163
|
+
# ==== Attributes
|
164
|
+
#
|
165
|
+
# * +layer+ - The layer the reported event belongs to
|
166
|
+
# * +kvs+ - A hash containing key/value pairs that will be reported along with this event (optional).
|
167
|
+
#
|
168
|
+
# ==== Example
|
169
|
+
#
|
170
|
+
# Oboe::API.log_info(:layer_name, { :id => @user.id })
|
136
171
|
#
|
137
172
|
# Returns an xtrace metadata string
|
138
173
|
def log_info(layer, kvs = {})
|
@@ -144,8 +179,17 @@ module TraceView
|
|
144
179
|
##
|
145
180
|
# Public: Log an exit event
|
146
181
|
#
|
147
|
-
# A helper method to create and log an
|
148
|
-
#
|
182
|
+
# A helper method to create and log an exit event
|
183
|
+
#
|
184
|
+
# ==== Attributes
|
185
|
+
#
|
186
|
+
# * +layer+ - The layer the reported event belongs to
|
187
|
+
# * +kvs+ - A hash containing key/value pairs that will be reported along with this event (optional).
|
188
|
+
# * +op+ - To identify the current operation being traced. Used to avoid double tracing recursive calls.
|
189
|
+
#
|
190
|
+
# ==== Example
|
191
|
+
#
|
192
|
+
# Oboe::API.log_exit(:layer_name, { :id => @user.id })
|
149
193
|
#
|
150
194
|
# Returns an xtrace metadata string
|
151
195
|
def log_exit(layer, kvs = {}, op = nil)
|
@@ -155,23 +199,25 @@ module TraceView
|
|
155
199
|
end
|
156
200
|
end
|
157
201
|
|
202
|
+
##
|
158
203
|
# Internal: Report an event.
|
159
204
|
#
|
160
|
-
#
|
161
|
-
# label - The label for the reported event. See API documentation for
|
162
|
-
# reserved labels and usage.
|
163
|
-
# opts - A hash containing key/value pairs that will be reported along
|
164
|
-
# with this event (optional).
|
205
|
+
# ==== Attributes
|
165
206
|
#
|
166
|
-
#
|
207
|
+
# * +layer+ - The layer the reported event belongs to
|
208
|
+
# * +label+ - The label for the reported event. See API documentation for reserved labels and usage.
|
209
|
+
# * +event+ - The pre-existing TraceView context event. See TraceView::Context.createEvent
|
210
|
+
# * +opts+ - A hash containing key/value pairs that will be reported along with this event (optional).
|
211
|
+
#
|
212
|
+
# ==== Example
|
167
213
|
#
|
168
214
|
# entry = TraceView::Context.createEvent
|
169
|
-
# log_event(
|
170
|
-
#
|
171
|
-
#
|
172
|
-
#
|
215
|
+
# Oboe::API.log_event(:layer_name, 'entry', entry_event, { :id => @user.id })
|
216
|
+
#
|
217
|
+
# exit_event = TraceView::Context.createEvent
|
218
|
+
# exit_event.addEdge(entry.getMetadata)
|
219
|
+
# Oboe::API.log_event(:layer_name, 'exit', exit_event, { :id => @user.id })
|
173
220
|
#
|
174
|
-
# Returns nothing.
|
175
221
|
def log_event(layer, label, event, opts = {})
|
176
222
|
if TraceView.loaded
|
177
223
|
event.addInfo('Layer', layer.to_s) if layer
|
data/lib/traceview/inst/moped.rb
CHANGED
@@ -264,10 +264,10 @@ if defined?(::Moped) && TraceView::Config[:moped][:enabled]
|
|
264
264
|
end
|
265
265
|
|
266
266
|
TraceView::API.trace('mongo', report_kvs) do
|
267
|
-
update_without_traceview(change, flags
|
267
|
+
update_without_traceview(change, flags)
|
268
268
|
end
|
269
269
|
else
|
270
|
-
update_without_traceview(change, flags
|
270
|
+
update_without_traceview(change, flags)
|
271
271
|
end
|
272
272
|
end
|
273
273
|
|
data/lib/traceview/util.rb
CHANGED
@@ -142,18 +142,14 @@ module TraceView
|
|
142
142
|
##
|
143
143
|
# to_query
|
144
144
|
#
|
145
|
-
# Used
|
146
|
-
# query. A backport of Hash#to_query.
|
145
|
+
# Used to convert a hash into a URL # query.
|
147
146
|
#
|
148
147
|
def to_query(h)
|
149
148
|
return "" unless h.is_a?(Hash)
|
150
149
|
|
151
|
-
# If called from a newer Ruby, use the builtin.
|
152
|
-
return h.to_query if RUBY_VERSION >= '1.9.3'
|
153
|
-
|
154
150
|
result = []
|
155
151
|
|
156
|
-
h.each { |k, v| result.push
|
152
|
+
h.each { |k, v| result.push(k.to_s + '=' + v.to_s) }
|
157
153
|
return result.sort.join('&')
|
158
154
|
end
|
159
155
|
|
@@ -167,38 +163,38 @@ module TraceView
|
|
167
163
|
platform_info = { '__Init' => 1 }
|
168
164
|
|
169
165
|
begin
|
170
|
-
platform_info['Force']
|
171
|
-
platform_info['Ruby.Platform.Version']
|
172
|
-
platform_info['Ruby.Version']
|
166
|
+
platform_info['Force'] = true
|
167
|
+
platform_info['Ruby.Platform.Version'] = RUBY_PLATFORM
|
168
|
+
platform_info['Ruby.Version'] = RUBY_VERSION
|
173
169
|
platform_info['Ruby.TraceView.Version'] = ::TraceView::Version::STRING
|
174
170
|
platform_info['RubyHeroku.TraceView.Version'] = ::TraceViewHeroku::Version::STRING if defined?(::TraceViewHeroku)
|
175
|
-
platform_info['Ruby.TraceMode.Version']
|
171
|
+
platform_info['Ruby.TraceMode.Version'] = ::TraceView::Config[:tracing_mode]
|
176
172
|
|
177
173
|
# Report the framework in use
|
178
|
-
if defined?(::RailsLts)
|
179
|
-
platform_info['Ruby.RailsLts.Version']
|
180
|
-
elsif defined?(::Rails)
|
181
|
-
platform_info['Ruby.Rails.Version']
|
174
|
+
if defined?(::RailsLts::VERSION)
|
175
|
+
platform_info['Ruby.RailsLts.Version'] = "RailsLts-#{::RailsLts::VERSION}"
|
176
|
+
elsif defined?(::Rails.version)
|
177
|
+
platform_info['Ruby.Rails.Version'] = "Rails-#{::Rails.version}"
|
182
178
|
end
|
183
|
-
platform_info['Ruby.Grape.Version']
|
184
|
-
platform_info['Ruby.Cramp.Version']
|
179
|
+
platform_info['Ruby.Grape.Version'] = "Grape-#{::Grape::VERSION}" if defined?(::Grape::VERSION)
|
180
|
+
platform_info['Ruby.Cramp.Version'] = "Cramp-#{::Cramp::VERSION}" if defined?(::Cramp::VERSION)
|
185
181
|
|
186
|
-
if defined?(::Padrino)
|
187
|
-
platform_info['Ruby.Padrino.Version']
|
188
|
-
elsif defined?(::Sinatra)
|
189
|
-
platform_info['Ruby.Sinatra.Version']
|
182
|
+
if defined?(::Padrino::VERSION)
|
183
|
+
platform_info['Ruby.Padrino.Version'] = "Padrino-#{::Padrino::VERSION}"
|
184
|
+
elsif defined?(::Sinatra::VERSION)
|
185
|
+
platform_info['Ruby.Sinatra.Version'] = "Sinatra-#{::Sinatra::VERSION}"
|
190
186
|
end
|
191
187
|
|
192
188
|
# Report the instrumented libraries
|
193
|
-
platform_info['Ruby.Cassandra.Version'] = "Cassandra-#{::Cassandra.VERSION}" if defined?(::Cassandra)
|
194
|
-
platform_info['Ruby.Dalli.Version'] = "Dalli-#{::Dalli::VERSION}" if defined?(::Dalli)
|
189
|
+
platform_info['Ruby.Cassandra.Version'] = "Cassandra-#{::Cassandra.VERSION}" if defined?(::Cassandra.VERSION)
|
190
|
+
platform_info['Ruby.Dalli.Version'] = "Dalli-#{::Dalli::VERSION}" if defined?(::Dalli::VERSION)
|
195
191
|
platform_info['Ruby.Excon.Version'] = "Excon-#{::Excon::VERSION}" if defined?(::Excon::VERSION)
|
196
|
-
platform_info['Ruby.Faraday.Version'] = "Faraday-#{::Faraday::VERSION}" if defined?(::Faraday)
|
192
|
+
platform_info['Ruby.Faraday.Version'] = "Faraday-#{::Faraday::VERSION}" if defined?(::Faraday::VERSION)
|
197
193
|
platform_info['Ruby.HTTPClient.Version'] = "HTTPClient-#{::HTTPClient::VERSION}" if defined?(::HTTPClient::VERSION)
|
198
|
-
platform_info['Ruby.MemCache.Version'] = "MemCache-#{::MemCache::VERSION}" if defined?(::MemCache)
|
199
|
-
platform_info['Ruby.Moped.Version'] = "Moped-#{::Moped::VERSION}" if defined?(::Moped)
|
200
|
-
platform_info['Ruby.Redis.Version'] = "Redis-#{::Redis::VERSION}" if defined?(::Redis)
|
201
|
-
platform_info['Ruby.Resque.Version'] = "Resque-#{::Resque::VERSION}" if defined?(::Resque)
|
194
|
+
platform_info['Ruby.MemCache.Version'] = "MemCache-#{::MemCache::VERSION}" if defined?(::MemCache::VERSION)
|
195
|
+
platform_info['Ruby.Moped.Version'] = "Moped-#{::Moped::VERSION}" if defined?(::Moped::VERSION)
|
196
|
+
platform_info['Ruby.Redis.Version'] = "Redis-#{::Redis::VERSION}" if defined?(::Redis::VERSION)
|
197
|
+
platform_info['Ruby.Resque.Version'] = "Resque-#{::Resque::VERSION}" if defined?(::Resque::VERSION)
|
202
198
|
platform_info['Ruby.RestClient.Version'] = "RestClient-#{::RestClient::VERSION}" if defined?(::RestClient::VERSION)
|
203
199
|
platform_info['Ruby.Typhoeus.Version'] = "Typhoeus-#{::Typhoeus::VERSION}" if defined?(::Typhoeus::VERSION)
|
204
200
|
|
@@ -214,19 +210,19 @@ module TraceView
|
|
214
210
|
platform_info['Ruby.Sequel.Version'] = ::Sequel::VERSION if defined?(::Sequel::VERSION)
|
215
211
|
|
216
212
|
# Report the server in use (if possible)
|
217
|
-
if defined?(::Unicorn)
|
213
|
+
if defined?(::Unicorn::Const::UNICORN_VERSION)
|
218
214
|
platform_info['Ruby.AppContainer.Version'] = "Unicorn-#{::Unicorn::Const::UNICORN_VERSION}"
|
219
|
-
elsif defined?(::Puma)
|
215
|
+
elsif defined?(::Puma::Const::PUMA_VERSION)
|
220
216
|
platform_info['Ruby.AppContainer.Version'] = "Puma-#{::Puma::Const::PUMA_VERSION} (#{::Puma::Const::CODE_NAME})"
|
221
|
-
elsif defined?(::PhusionPassenger)
|
217
|
+
elsif defined?(::PhusionPassenger::PACKAGE_NAME)
|
222
218
|
platform_info['Ruby.AppContainer.Version'] = "#{::PhusionPassenger::PACKAGE_NAME}-#{::PhusionPassenger::VERSION_STRING}"
|
223
|
-
elsif defined?(::Thin)
|
219
|
+
elsif defined?(::Thin::VERSION::STRING)
|
224
220
|
platform_info['Ruby.AppContainer.Version'] = "Thin-#{::Thin::VERSION::STRING} (#{::Thin::VERSION::CODENAME})"
|
225
|
-
elsif defined?(::Mongrel)
|
221
|
+
elsif defined?(::Mongrel::Const::MONGREL_VERSION)
|
226
222
|
platform_info['Ruby.AppContainer.Version'] = "Mongrel-#{::Mongrel::Const::MONGREL_VERSION}"
|
227
|
-
elsif defined?(::Mongrel2)
|
223
|
+
elsif defined?(::Mongrel2::VERSION)
|
228
224
|
platform_info['Ruby.AppContainer.Version'] = "Mongrel2-#{::Mongrel2::VERSION}"
|
229
|
-
elsif defined?(::Trinidad)
|
225
|
+
elsif defined?(::Trinidad::VERSION)
|
230
226
|
platform_info['Ruby.AppContainer.Version'] = "Trinidad-#{::Trinidad::VERSION}"
|
231
227
|
elsif defined?(::WEBrick::VERSION)
|
232
228
|
platform_info['Ruby.AppContainer.Version'] = "WEBrick-#{::WEBrick::VERSION}"
|