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.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +39 -14
  3. data/Gemfile +4 -62
  4. data/Rakefile +23 -8
  5. data/gemfiles/frameworks.gemfile +40 -0
  6. data/gemfiles/libraries.gemfile +78 -0
  7. data/gemfiles/rails23.gemfile +47 -0
  8. data/gemfiles/rails30.gemfile +47 -0
  9. data/gemfiles/rails31.gemfile +47 -0
  10. data/gemfiles/rails32.gemfile +47 -0
  11. data/gemfiles/rails40.gemfile +35 -0
  12. data/gemfiles/rails41.gemfile +35 -0
  13. data/gemfiles/rails42.gemfile +35 -0
  14. data/lib/traceview/api/logging.rb +84 -38
  15. data/lib/traceview/frameworks/rails/inst/action_controller.rb +1 -1
  16. data/lib/traceview/inst/moped.rb +2 -2
  17. data/lib/traceview/util.rb +30 -34
  18. data/lib/traceview/version.rb +1 -1
  19. data/test/frameworks/apps/grape_nested.rb +3 -0
  20. data/test/frameworks/apps/grape_simple.rb +3 -0
  21. data/test/frameworks/apps/sinatra_simple.rb +3 -0
  22. data/test/frameworks/grape_test.rb +8 -4
  23. data/test/frameworks/padrino_test.rb +6 -2
  24. data/test/frameworks/rails2x_test.rb +3 -0
  25. data/test/frameworks/rails3x_test.rb +91 -0
  26. data/test/frameworks/rails4x_test.rb +89 -0
  27. data/test/frameworks/sinatra_test.rb +3 -0
  28. data/test/instrumentation/cassandra_test.rb +11 -4
  29. data/test/instrumentation/dalli_test.rb +3 -0
  30. data/test/instrumentation/em_http_request_test.rb +3 -0
  31. data/test/instrumentation/excon_test.rb +3 -0
  32. data/test/instrumentation/faraday_test.rb +3 -0
  33. data/test/instrumentation/http_test.rb +3 -0
  34. data/test/instrumentation/httpclient_test.rb +3 -0
  35. data/test/instrumentation/memcache_test.rb +9 -0
  36. data/test/instrumentation/memcached_test.rb +3 -0
  37. data/test/instrumentation/mongo_test.rb +14 -3
  38. data/test/instrumentation/moped_test.rb +29 -6
  39. data/test/instrumentation/rack_test.rb +3 -0
  40. data/test/instrumentation/redis_hashes_test.rb +187 -184
  41. data/test/instrumentation/redis_keys_test.rb +223 -220
  42. data/test/instrumentation/redis_lists_test.rb +225 -225
  43. data/test/instrumentation/redis_misc_test.rb +123 -120
  44. data/test/instrumentation/redis_sets_test.rb +216 -213
  45. data/test/instrumentation/redis_sortedsets_test.rb +245 -242
  46. data/test/instrumentation/redis_strings_test.rb +242 -238
  47. data/test/instrumentation/resque_test.rb +3 -0
  48. data/test/instrumentation/rest-client_test.rb +3 -0
  49. data/test/instrumentation/sequel_mysql2_test.rb +4 -1
  50. data/test/instrumentation/sequel_mysql_test.rb +4 -1
  51. data/test/instrumentation/sequel_pg_test.rb +4 -1
  52. data/test/minitest_helper.rb +25 -8
  53. data/test/profiling/method_test.rb +3 -0
  54. data/test/servers/rackapp_8101.rb +1 -1
  55. data/test/servers/rails2x_8140.rb +2 -2
  56. data/test/servers/rails3x_8140.rb +78 -0
  57. data/test/servers/rails4x_8140.rb +78 -0
  58. data/test/support/backcompat_test.rb +3 -0
  59. data/test/support/config_test.rb +3 -0
  60. data/test/support/dnt_test.rb +3 -0
  61. data/test/support/liboboe_settings_test.rb +3 -0
  62. data/test/support/tvalias_test.rb +3 -0
  63. data/test/support/xtrace_test.rb +3 -0
  64. metadata +19 -5
  65. data/Appraisals +0 -10
  66. data/gemfiles/mongo.gemfile +0 -33
  67. 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
- # layer - The layer the reported event belongs to
12
- # label - The label for the reported event. See API documentation for
13
- # reserved labels and usage.
14
- # opts - A hash containing key/value pairs that will be reported along
15
- # with this event (optional).
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
- # layer - The layer the reported event belongs to
33
- # exn - The exception to report
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
- # function_without_traceview()
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
- # layer - The layer the reported event belongs to
60
- # xtrace - An xtrace metadata string, or nil.
61
- # opts - A hash containing key/value pairs that will be reported along
62
- # with this event (optional).
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
- # Public: Report an exit event.
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
- # layer - The layer the reported event belongs to
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
- # entry event
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
- # info event
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
- # exit event
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
- # layer - The layer the reported event belongs to
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
- # Examples
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('rails', 'entry', exit, { :controller => 'user', :action => 'index' })
170
- # exit = TraceView::Context.createEvent
171
- # exit.addEdge(entry.getMetadata)
172
- # log_event('rails', 'exit', exit)
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
@@ -138,7 +138,7 @@ module TraceView
138
138
  :Action => self.action_name,
139
139
  }
140
140
 
141
- TraceView::API.log_entry('rails')
141
+ TraceView::API.log_entry('rails', report_kvs)
142
142
  process_action_without_traceview(method_name, *args)
143
143
 
144
144
  rescue Exception => e
@@ -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 = nil)
267
+ update_without_traceview(change, flags)
268
268
  end
269
269
  else
270
- update_without_traceview(change, flags = nil)
270
+ update_without_traceview(change, flags)
271
271
  end
272
272
  end
273
273
 
@@ -142,18 +142,14 @@ module TraceView
142
142
  ##
143
143
  # to_query
144
144
  #
145
- # Used under Ruby 1.8.7 to convert a hash into a URL
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 (k.to_s + '=' + v.to_s) }
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'] = true
171
- platform_info['Ruby.Platform.Version'] = RUBY_PLATFORM
172
- platform_info['Ruby.Version'] = 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'] = ::TraceView::Config[:tracing_mode]
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'] = "RailsLts-#{::RailsLts::VERSION}"
180
- elsif defined?(::Rails)
181
- platform_info['Ruby.Rails.Version'] = "Rails-#{::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'] = "Grape-#{::Grape::VERSION}" if defined?(::Grape)
184
- platform_info['Ruby.Cramp.Version'] = "Cramp-#{::Cramp::VERSION}" if defined?(::Cramp)
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'] = "Padrino-#{::Padrino::VERSION}"
188
- elsif defined?(::Sinatra)
189
- platform_info['Ruby.Sinatra.Version'] = "Sinatra-#{::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}"