traceview 3.8.2 → 3.8.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c2ad7500e12f73a8f119c9b910c08b187266ab2e
4
- data.tar.gz: 5424df41c5841e2734715ddb9af8af83105c0f92
3
+ metadata.gz: 32b865d51e3fb70e212c5fb02f043c1af940dff1
4
+ data.tar.gz: 37f29c3fc9cb2caf79a5e872e39e5f058e622f2d
5
5
  SHA512:
6
- metadata.gz: 65aa01b7ae931f6893d0ba49c9d4e1475e05f6fce58a4a34c868fde0fb2d9177704b2c97f86f99750e8817b5d9c494692cdb3bc82c9d67d6eafacc85f70ff9d5
7
- data.tar.gz: dec80efa11990bd966a57c9f9c6380203716763e078c4eee80ddffc780b7465ffc5d7e6a8a20eb07f5c60c223604b02de88b9bfb1eae8a7c3b8c93c4bdff3c09
6
+ metadata.gz: 2415dbcc5597523fae2e474c6f2c1c90900a9b6f800e35fc6b23fb8c63b8139fdcba2ab27c690b6dd674a1cb9d87fc9e5dababb6fe6f9aa6ecaea4e6562a09fd
7
+ data.tar.gz: b362aa442657b6b8161e7fc82fc01b5cf7a3834d3780a0a44f9f63927a10c0cfdf9e4d5e1ed35987d97c2030ba298dbe6259a142670ba9ba674b8a99d5b8acda
@@ -4,7 +4,20 @@ https://github.com/appneta/ruby-traceview/releases
4
4
 
5
5
  Dates in this file are in the format MM/DD/YYYY.
6
6
 
7
- # traceview 3.8.2
7
+ # traceview 3.8.3 (08/29/2016)
8
+
9
+ This patch release includes the following fixes:
10
+
11
+ * Updates to test suite: Rails servers and Curb instrumentation
12
+ * Updated Sequel instrumentation to follow latest gem changes: bc2b715b6fd6575de2969e25705ec1fd8e51c236
13
+ * Updated Excon instrumentation to follow latest gem changes: c35ac53d6fd614e86d388e3f6c0f050341cc4f37
14
+
15
+ Pushed to Rubygems:
16
+
17
+ https://rubygems.org/gems/traceview/versions/3.8.3
18
+ https://rubygems.org/gems/traceview/versions/3.8.3-java
19
+
20
+ # traceview 3.8.2 (06/09/2016)
8
21
 
9
22
  This patch release includes the following fixes:
10
23
 
@@ -16,7 +16,8 @@ end
16
16
 
17
17
  # New mime-types/mime-types-data requires ruby 2.0
18
18
  if RUBY_VERSION < '2.0'
19
- gem 'mime-types', '< 3.0'
19
+ # these gems dropped suport for < ruby version 2.0
20
+ gem 'json', '< 2.0.0'
20
21
  end
21
22
 
22
23
  if defined?(JRUBY_VERSION)
@@ -25,15 +26,18 @@ else
25
26
  gem 'sinatra'
26
27
  end
27
28
 
28
- gem "grape"
29
+ if RUBY_VERSION > '1.9.3'
30
+ gem "grape"
29
31
 
30
- if defined?(JRUBY_VERSION)
31
- # Limit padrino gem under JRuby as version 0.13.0 throws
32
- # a bundler load error
33
- gem "padrino", '< 0.13.0'
34
- else
35
- gem 'padrino'
32
+ if defined?(JRUBY_VERSION)
33
+ # Limit padrino gem under JRuby as version 0.13.0 throws
34
+ # a bundler load error
35
+ gem "padrino", '< 0.13.0'
36
+ else
37
+ gem 'padrino'
38
+ end
36
39
  end
37
40
 
41
+
38
42
  gemspec :path => File.expand_path(File.dirname(__FILE__) + '/../')
39
43
  # vim:syntax=ruby
@@ -1,15 +1,21 @@
1
1
  source "https://rubygems.org"
2
2
 
3
+
3
4
  if RUBY_VERSION >= '1.9.3'
4
- # rest-client depends on mime-types gem which only supports
5
- # ruby 1.9.3 and up
6
- gem 'rest-client'
7
5
  gem 'moped'
8
6
  gem 'eventmachine', '< 1.2.0'
9
7
  gem 'em-synchrony'
10
8
  gem 'em-http-request'
11
9
  end
12
10
 
11
+ if RUBY_VERSION >= '2.0.0'
12
+ # rest-client depends on mime-types gem which only supports
13
+ # ruby 1.9.3 and up. Latest rest-client only
14
+ # supports Ruby 2.0+
15
+ gem 'rest-client'
16
+ end
17
+
18
+
13
19
  group :development, :test do
14
20
  gem 'minitest'
15
21
  gem 'minitest-reporters', '< 1.0.18'
@@ -32,8 +38,16 @@ else
32
38
  gem 'sinatra'
33
39
  end
34
40
 
41
+ if RUBY_VERSION.between?('1.8.7', '1.9.3')
42
+ # Nothing
43
+ elsif RUBY_VERSION == '1.9.3'
44
+ gem 'mime-types', '< 3.0'
45
+ end
46
+
35
47
  if RUBY_VERSION < '2.0.0'
36
48
  gem 'bunny', '< 2.0.0'
49
+ # these gems dropped suport for < ruby version 2.0
50
+ gem 'json', '< 2.0.0'
37
51
  else
38
52
  gem 'bunny'
39
53
  end
@@ -11,11 +11,9 @@ module TraceView
11
11
  # layer.
12
12
  #
13
13
  def report_init(layer = :rack)
14
- # Don't send __Init in development, test or if the gem
14
+ # Don't send __Init in test or if we're
15
15
  # isn't fully loaded (e.g. missing c-extension)
16
- return if %w(development test).include?(ENV['RACK_ENV']) ||
17
- ENV.key?('TRACEVIEW_GEM_TEST') ||
18
- !TraceView.loaded
16
+ return if ENV.key?('TRACEVIEW_GEM_TEST') || !TraceView.loaded
19
17
 
20
18
  platform_info = TraceView::Util.build_init_report
21
19
 
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2015 AppNeta, Inc.
1
+ # Copyright (c) 2016 AppNeta, Inc.
2
2
  # All rights reserved.
3
3
 
4
4
  module TraceView
@@ -38,7 +38,10 @@ module TraceView
38
38
  kvs
39
39
  rescue => e
40
40
  TraceView.logger.debug "[traceview/debug] Error capturing curb KVs: #{e.message}"
41
- TraceView.logger.debug e.backtrace.join('\n') if ::TraceView::Config[:verbose]
41
+ if TraceView::Config[:verbose]
42
+ TraceView.logger.debug "[traceview/debug] #{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}"
43
+ TraceView.logger.debug e.backtrace.join('\n')
44
+ end
42
45
  ensure
43
46
  return kvs
44
47
  end
@@ -78,9 +81,6 @@ module TraceView
78
81
  kvs[:Location] = headers["Location"]
79
82
  end
80
83
 
81
- # Curb only provides a single long string of all response headers (yuck!). So we are forced
82
- # to process that string to pull out the response X-Trace value.
83
- # Taken from https://stackoverflow.com/questions/14345805/curb-get-response-headers
84
84
  _, *response_headers = header_str.split(/[\r\n]+/).map(&:strip)
85
85
  response_headers = Hash[response_headers.flat_map{ |s| s.scan(/^(\S+): (.+)/) }]
86
86
 
@@ -97,7 +97,6 @@ module TraceView
97
97
  ensure
98
98
  TraceView::API.log_exit(:curb, kvs)
99
99
  end
100
-
101
100
  end
102
101
  end # CurlUtility
103
102
 
@@ -19,6 +19,15 @@ module TraceView
19
19
  def extract_trace_details(sql, opts)
20
20
  kvs = {}
21
21
 
22
+ if !sql.is_a?(String)
23
+ kvs[:IsPreparedStatement] = true
24
+ end
25
+
26
+ if ::Sequel::VERSION > '4.36.0' && !sql.is_a?(String)
27
+ # In 4.37.0, sql was converted to a prepared statement object
28
+ sql = sql.prepared_sql unless sql.is_a?(Symbol)
29
+ end
30
+
22
31
  if TraceView::Config[:sanitize_sql]
23
32
  # Sanitize SQL and don't report binds
24
33
  if sql.is_a?(Symbol)
@@ -31,7 +40,6 @@ module TraceView
31
40
  kvs[:Query] = sql.to_s
32
41
  kvs[:QueryArgs] = opts[:arguments] if opts.is_a?(Hash) && opts.key?(:arguments)
33
42
  end
34
- kvs[:IsPreparedStatement] = true if sql.is_a?(Symbol)
35
43
 
36
44
  kvs[:Backtrace] = TraceView::API.backtrace if TraceView::Config[:sequel][:collect_backtraces]
37
45
 
@@ -11,7 +11,7 @@ module TraceView
11
11
  report_kvs = {}
12
12
  worker_class, msg, queue, _ = args
13
13
 
14
- report_kvs[:Spec] = :msgclient
14
+ report_kvs[:Spec] = :pushq
15
15
  report_kvs[:Flavor] = :sidekiq
16
16
  report_kvs[:Queue] = queue
17
17
  report_kvs[:Retry] = msg['retry']
@@ -8,7 +8,7 @@ module TraceView
8
8
  module Version
9
9
  MAJOR = 3
10
10
  MINOR = 8
11
- PATCH = 2
11
+ PATCH = 3
12
12
  BUILD = nil
13
13
 
14
14
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
@@ -0,0 +1,14 @@
1
+ # Copyright (c) 2015 AppNeta, Inc.
2
+ # All rights reserved.
3
+
4
+ require 'minitest_helper'
5
+
6
+ class BenchAllocations < Minitest::Test
7
+ def test_trace_api
8
+ assert_allocations 42 do
9
+ TraceView::API.start_trace('bench') do
10
+ nil
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,15 @@
1
+ # Copyright (c) 2015 AppNeta, Inc.
2
+ # All rights reserved.
3
+
4
+ require 'minitest_helper'
5
+
6
+ class BenchTracingAPI < MiniTest::Benchmark
7
+ def bench_api
8
+ skip
9
+ assert_performance_linear 0.99 do |input|
10
+ TraceView::API.start_trace('bench') do
11
+ nil
12
+ end
13
+ end
14
+ end
15
+ end
@@ -169,9 +169,9 @@ class ExconTest < Minitest::Test
169
169
  assert_equal 'GET', traces[1]['HTTPMethod']
170
170
  assert traces[1].key?('Backtrace')
171
171
 
172
- assert_equal 'excon', traces[2]['Layer']
173
- assert_equal 'error', traces[2]['Label']
174
- assert_equal "Excon::Errors::SocketError", traces[2]['ErrorClass']
172
+ assert_equal 'excon', traces[2]['Layer']
173
+ assert_equal 'error', traces[2]['Label']
174
+ assert_equal "Excon::Error::Socket", traces[2]['ErrorClass']
175
175
  assert traces[2].key?('ErrorMsg')
176
176
  assert traces[2].key?('Backtrace')
177
177
 
@@ -3,7 +3,7 @@
3
3
 
4
4
  require 'minitest_helper'
5
5
 
6
- if RUBY_VERSION >= '1.9.3'
6
+ if RUBY_VERSION >= '2.0.0'
7
7
  describe "RestClient" do
8
8
  before do
9
9
  clear_all_traces
@@ -269,10 +269,17 @@ if defined?(::Sequel) && !defined?(JRUBY_VERSION)
269
269
  validate_outer_layers(traces, 'sequel_test')
270
270
 
271
271
  validate_event_keys(traces[1], @entry_kvs)
272
- traces[1]['Query'].must_equal "SELECT * FROM `items` WHERE (`name` = 'abc')"
273
- traces[1].has_key?('Backtrace').must_equal TraceView::Config[:sequel][:collect_backtraces]
274
- traces[3]['Query'].must_equal "DELETE FROM `items` WHERE (`name` = 'cba')"
275
- traces[3].has_key?('Backtrace').must_equal TraceView::Config[:sequel][:collect_backtraces]
272
+ if ::Sequel::VERSION > '4.36.0'
273
+ traces[1]['Query'].must_equal "SELECT * FROM `items` WHERE (`name` = ?)"
274
+ traces[1].has_key?('Backtrace').must_equal TraceView::Config[:sequel][:collect_backtraces]
275
+ traces[3]['Query'].must_equal "DELETE FROM `items` WHERE (`name` = ?)"
276
+ traces[3].has_key?('Backtrace').must_equal TraceView::Config[:sequel][:collect_backtraces]
277
+ else
278
+ traces[1]['Query'].must_equal "SELECT * FROM `items` WHERE (`name` = 'abc')"
279
+ traces[1].has_key?('Backtrace').must_equal TraceView::Config[:sequel][:collect_backtraces]
280
+ traces[3]['Query'].must_equal "DELETE FROM `items` WHERE (`name` = 'cba')"
281
+ traces[3].has_key?('Backtrace').must_equal TraceView::Config[:sequel][:collect_backtraces]
282
+ end
276
283
  validate_event_keys(traces[2], @exit_kvs)
277
284
  end
278
285
 
@@ -290,7 +297,13 @@ if defined?(::Sequel) && !defined?(JRUBY_VERSION)
290
297
  validate_outer_layers(traces, 'sequel_test')
291
298
 
292
299
  validate_event_keys(traces[1], @entry_kvs)
293
- traces[1]['Query'].must_equal "select_by_name"
300
+
301
+ if ::Sequel::VERSION > '4.36.0'
302
+ traces[1]['Query'].must_equal "SELECT * FROM `items` WHERE (`name` = ?)"
303
+ else
304
+ traces[1]['Query'].must_equal "select_by_name"
305
+ end
306
+
294
307
  if RUBY_VERSION < "1.9"
295
308
  traces[1]['QueryArgs'].must_equal "abc"
296
309
  else
@@ -316,7 +329,13 @@ if defined?(::Sequel) && !defined?(JRUBY_VERSION)
316
329
  validate_outer_layers(traces, 'sequel_test')
317
330
 
318
331
  validate_event_keys(traces[1], @entry_kvs)
319
- traces[1]['Query'].must_equal "select_by_name"
332
+
333
+ if ::Sequel::VERSION > '4.36.0'
334
+ traces[1]['Query'].must_equal "SELECT * FROM `items` WHERE (`name` = ?)"
335
+ else
336
+ traces[1]['Query'].must_equal "select_by_name"
337
+ end
338
+
320
339
  traces[1]['QueryArgs'].must_equal nil
321
340
  traces[1]['IsPreparedStatement'].must_equal "true"
322
341
  traces[1].has_key?('Backtrace').must_equal TraceView::Config[:sequel][:collect_backtraces]
@@ -36,7 +36,7 @@ if RUBY_VERSION >= '2.0' && !defined?(JRUBY_VERSION)
36
36
  assert_equal 'sidekiq-client', traces[1]['Layer']
37
37
  assert_equal 'entry', traces[1]['Label']
38
38
 
39
- assert_equal 'msgclient', traces[1]['Spec']
39
+ assert_equal 'pushq', traces[1]['Spec']
40
40
  assert_equal 'sidekiq', traces[1]['Flavor']
41
41
  assert_equal 'critical', traces[1]['Queue']
42
42
  assert_equal jid, traces[1]['MsgID']
@@ -1,9 +1,12 @@
1
1
  # Copyright (c) 2015 AppNeta, Inc.
2
2
  # All rights reserved.
3
3
 
4
+ # This is a Rails app that launches a DelayedJob worker
5
+ # in a background thread.
6
+ #
4
7
  require "rails/all"
5
8
  require "delayed_job"
6
- require "action_controller/railtie" # require more if needed
9
+ require "action_controller/railtie"
7
10
  require 'rack/handler/puma'
8
11
  require File.expand_path(File.dirname(__FILE__) + '/../models/widget')
9
12
 
@@ -30,25 +33,12 @@ class Rails40MetalStack < Rails::Application
30
33
  get "/hello/metal" => "ferro#world"
31
34
  end
32
35
 
33
- # Enable cache classes. Production style.
34
36
  config.cache_classes = true
35
37
  config.eager_load = false
36
-
37
- # uncomment below to display errors
38
- # config.consider_all_requests_local = true
39
-
40
38
  config.active_support.deprecation = :stderr
41
-
42
- # Here you could remove some middlewares, for example
43
- # Rack::Lock, ActionDispatch::Flash and ActionDispatch::BestStandardsSupport below.
44
- # The remaining stack is printed on rackup (for fun!).
45
- # Rails API has config.middleware.api_only! to get
46
- # rid of browser related middleware.
47
39
  config.middleware.delete "Rack::Lock"
48
40
  config.middleware.delete "ActionDispatch::Flash"
49
41
  config.middleware.delete "ActionDispatch::BestStandardsSupport"
50
-
51
- # We need a secret token for session, cookies, etc.
52
42
  config.secret_token = "49837489qkuweoiuoqwehisuakshdjksadhaisdy78o34y138974xyqp9rmye8yrpiokeuioqwzyoiuxftoyqiuxrhm3iou1hrzmjk"
53
43
  config.secret_key_base = "2048671-96803948"
54
44
  end
@@ -1,6 +1,9 @@
1
1
  # Copyright (c) 2015 AppNeta, Inc.
2
2
  # All rights reserved.
3
3
 
4
+ # This is a Rack application that is booted in a background
5
+ # thread and listens on port 8101.
6
+ #
4
7
  require 'rack/handler/puma'
5
8
  require 'traceview/inst/rack'
6
9
 
@@ -1,29 +1,17 @@
1
- # Taken from: https://www.amberbit.com/blog/2014/2/14/putting-ruby-on-rails-on-a-diet/
2
- # Port of https://gist.github.com/josevalim/1942658 to Rails 4
3
- # Original author: Jose Valim
4
- # Updated by: Peter Giacomo Lombardo
5
- #
6
- # Run this file with:
7
- #
8
- # bundle exec RAILS_ENV=production rackup -p 3000 -s thin
9
- #
10
- # And access:
11
- #
12
- # http://localhost:3000/hello/world
1
+ ##
2
+ # Copyright (c) 2016 AppNeta, Inc.
3
+ # All rights reserved.
4
+
5
+ # This is a Rails stack that launches on a background
6
+ # thread and listens on port 8140.
13
7
  #
14
- # The following lines should come as no surprise. Except by
15
- # ActionController::Metal, it follows the same structure of
16
- # config/application.rb, config/environment.rb and config.ru
17
- # existing in any Rails 4 app. Here they are simply in one
18
- # file and without the comments.
19
8
  require "rails/all"
20
- require "action_controller/railtie" # require more if needed
9
+ require "action_controller/railtie"
21
10
  require 'rack/handler/puma'
22
11
  require File.expand_path(File.dirname(__FILE__) + '/../models/widget')
23
12
 
24
13
  TraceView.logger.info "[traceview/info] Starting background utility rails app on localhost:8140."
25
14
 
26
- # Set the database. Default is postgresql.
27
15
  if ENV['DBTYPE'] == 'mysql2'
28
16
  TraceView::Test.set_mysql2_env
29
17
  elsif ENV['DBTYPE'] == 'mysql'
@@ -47,26 +35,13 @@ class Rails32MetalStack < Rails::Application
47
35
  get "/hello/db" => "hello#db"
48
36
  end
49
37
 
50
- # Enable cache classes. Production style.
51
38
  config.cache_classes = true
52
39
  config.eager_load = false
53
-
54
- # uncomment below to display errors
55
- # config.consider_all_requests_local = true
56
-
57
40
  config.active_support.deprecation = :stderr
58
-
59
- # Here you could remove some middlewares, for example
60
- # Rack::Lock, ActionDispatch::Flash and ActionDispatch::BestStandardsSupport below.
61
- # The remaining stack is printed on rackup (for fun!).
62
- # Rails API has config.middleware.api_only! to get
63
- # rid of browser related middleware.
64
41
  config.middleware.delete "Rack::Lock"
65
42
  config.middleware.delete "ActionDispatch::Flash"
66
43
  config.middleware.delete "ActionDispatch::BestStandardsSupport"
67
-
68
- # We need a secret token for session, cookies, etc.
69
- config.secret_token = "49837489qkuweoiuoqwehisuakshdjksadhaisdy78o34y138974xyqp9rmye8yrpiokeuioqwzyoiuxftoyqiuxrhm3iou1hrzmjk"
44
+ config.secret_token = "498374i49qkuweoiuoqwehisuakshdhksadhaisdy78o34y138974xyqu9rmye8yrpiokeuioqwzyo8uxftoyqiuxrhm3iou1hrzmjk"
70
45
  config.secret_key_base = "2048671-96803948"
71
46
  end
72
47
 
@@ -1,31 +1,17 @@
1
- # Taken from: https://www.amberbit.com/blog/2014/2/14/putting-ruby-on-rails-on-a-diet/
2
- # Port of https://gist.github.com/josevalim/1942658 to Rails 4
3
- # Original author: Jose Valim
4
- # Updated by: Peter Giacomo Lombardo
5
- #
6
- # Run this file with:
7
- #
8
- # bundle exec RAILS_ENV=production rackup -p 3000 -s thin
9
- #
10
- # And access:
11
- #
12
- # http://localhost:3000/hello/world
13
- #
14
- # The following lines should come as no surprise. Except by
15
- # ActionController::Metal, it follows the same structure of
16
- # config/application.rb, config/environment.rb and config.ru
17
- # existing in any Rails 4 app. Here they are simply in one
18
- # file and without the comments.
19
- #
1
+ ##
2
+ # Copyright (c) 2016 AppNeta, Inc.
3
+ # All rights reserved.
20
4
 
5
+ # This is a Rails stack that launches on a background
6
+ # thread and listens on port 8140.
7
+ #
21
8
  require "rails/all"
22
- require "action_controller/railtie" # require more if needed
9
+ require "action_controller/railtie"
23
10
  require 'rack/handler/puma'
24
11
  require File.expand_path(File.dirname(__FILE__) + '/../models/widget')
25
12
 
26
13
  TraceView.logger.info "[traceview/info] Starting background utility rails app on localhost:8140."
27
14
 
28
- # Set the database. Default is postgresql.
29
15
  if ENV['DBTYPE'] == 'mysql2'
30
16
  TraceView::Test.set_mysql2_env
31
17
  elsif ENV['DBTYPE'] == 'mysql'
@@ -49,26 +35,13 @@ class Rails40MetalStack < Rails::Application
49
35
  get "/hello/db" => "hello#db"
50
36
  end
51
37
 
52
- # Enable cache classes. Production style.
53
38
  config.cache_classes = true
54
39
  config.eager_load = false
55
-
56
- # uncomment below to display errors
57
- # config.consider_all_requests_local = true
58
-
59
40
  config.active_support.deprecation = :stderr
60
-
61
- # Here you could remove some middlewares, for example
62
- # Rack::Lock, ActionDispatch::Flash and ActionDispatch::BestStandardsSupport below.
63
- # The remaining stack is printed on rackup (for fun!).
64
- # Rails API has config.middleware.api_only! to get
65
- # rid of browser related middleware.
66
41
  config.middleware.delete "Rack::Lock"
67
42
  config.middleware.delete "ActionDispatch::Flash"
68
43
  config.middleware.delete "ActionDispatch::BestStandardsSupport"
69
-
70
- # We need a secret token for session, cookies, etc.
71
- config.secret_token = "49837489qkuweoiuoqwehisuakshdjksadhaisdy78o34y138974xyqp9rmye8yrpiokeuioqwzyoiuxftoyqiuxrhm3iou1hrzmjk"
44
+ config.secret_token = "49830489qkuweoiuoqwehisuakshdjksadhaisdy78o34y138974xyqp9rmye8yypiokeuioqwzyoiuxftoyqiuxrhm3iou1hrzmjk"
72
45
  config.secret_key_base = "2048671-96803948"
73
46
  end
74
47
 
@@ -1,24 +1,10 @@
1
- # Taken from: https://www.amberbit.com/blog/2014/2/14/putting-ruby-on-rails-on-a-diet/
2
- # Port of https://gist.github.com/josevalim/1942658 to Rails 4
3
- # Original author: Jose Valim
4
- # Updated by: Peter Giacomo Lombardo
5
- #
6
- # Run this file with:
7
- #
8
- # bundle exec RAILS_ENV=production rackup -p 3000 -s thin
9
- #
10
- # And access:
11
- #
12
- # http://localhost:3000/hello/world
13
- #
14
- # The following lines should come as no surprise. Except by
15
- # ActionController::Metal, it follows the same structure of
16
- # config/application.rb, config/environment.rb and config.ru
17
- # existing in any Rails 4 app. Here they are simply in one
18
- # file and without the comments.
19
- #
1
+ ##
2
+ # Copyright (c) 2016 AppNeta, Inc.
3
+ # All rights reserved.
20
4
 
21
- # Set the database. Default is postgresql.
5
+ # This is a Rails stack that launches on a background
6
+ # thread and listens on port 8140.
7
+ #
22
8
  if ENV['DBTYPE'] == 'mysql2'
23
9
  TraceView::Test.set_mysql2_env
24
10
  elsif ENV['DBTYPE'] == 'postgresql'
@@ -49,24 +35,11 @@ class Rails50MetalStack < Rails::Application
49
35
  get "/hello/db" => "hello#db"
50
36
  end
51
37
 
52
- # Enable cache classes. Production style.
53
38
  config.cache_classes = true
54
39
  config.eager_load = false
55
-
56
- # uncomment below to display errors
57
- # config.consider_all_requests_local = true
58
-
59
40
  config.active_support.deprecation = :stderr
60
-
61
- # Here you could remove some middlewares, for example
62
- # Rack::Lock, ActionDispatch::Flash and ActionDispatch::BestStandardsSupport below.
63
- # The remaining stack is printed on rackup (for fun!).
64
- # Rails API has config.middleware.api_only! to get
65
- # rid of browser related middleware.
66
41
  config.middleware.delete Rack::Lock
67
42
  config.middleware.delete ActionDispatch::Flash
68
-
69
- # We need a secret token for session, cookies, etc.
70
43
  config.secret_token = "49837489qkuweoiuoqwehisuakshdjksadhaisdy78o34y138974xyqp9rmye8yrpiokeuioqwzyoiuxftoyqiuxrhm3iou1hrzmjk"
71
44
  config.secret_key_base = "2048671-96803948"
72
45
  end
@@ -1,24 +1,10 @@
1
- # Taken from: https://www.amberbit.com/blog/2014/2/14/putting-ruby-on-rails-on-a-diet/
2
- # Port of https://gist.github.com/josevalim/1942658 to Rails 4
3
- # Original author: Jose Valim
4
- # Updated by: Peter Giacomo Lombardo
5
- #
6
- # Run this file with:
7
- #
8
- # bundle exec RAILS_ENV=production rackup -p 3000 -s thin
9
- #
10
- # And access:
11
- #
12
- # http://localhost:3000/hello/world
13
- #
14
- # The following lines should come as no surprise. Except by
15
- # ActionController::Metal, it follows the same structure of
16
- # config/application.rb, config/environment.rb and config.ru
17
- # existing in any Rails 4 app. Here they are simply in one
18
- # file and without the comments.
19
- #
1
+ ##
2
+ # Copyright (c) 2016 AppNeta, Inc.
3
+ # All rights reserved.
20
4
 
21
- # Set the database. Default is postgresql.
5
+ # This is a Rails API stack that launches on a background
6
+ # thread and listens on port 8150.
7
+ #
22
8
  if ENV['DBTYPE'] == 'mysql2'
23
9
  TraceView::Test.set_mysql2_env
24
10
  elsif ENV['DBTYPE'] == 'postgresql'
@@ -30,7 +16,6 @@ else
30
16
  end
31
17
 
32
18
  require "rails"
33
- # Pick the frameworks you want:
34
19
  require "active_model/railtie"
35
20
  require "active_job/railtie"
36
21
  require "active_record/railtie"
@@ -38,7 +23,6 @@ require "action_controller/railtie"
38
23
  require "action_mailer/railtie"
39
24
  require "action_view/railtie"
40
25
  require "action_cable/engine"
41
- # require "sprockets/railtie"
42
26
  require "rails/test_unit/railtie"
43
27
 
44
28
  require 'rack/handler/puma'
@@ -61,24 +45,11 @@ module Rails50APIStack
61
45
  get "/monkey/error" => "monkey#error"
62
46
  end
63
47
 
64
- # Enable cache classes. Production style.
65
48
  config.cache_classes = true
66
49
  config.eager_load = false
67
-
68
- # uncomment below to display errors
69
- # config.consider_all_requests_local = true
70
-
71
50
  config.active_support.deprecation = :stderr
72
-
73
- # Here you could remove some middlewares, for example
74
- # Rack::Lock, ActionDispatch::Flash and ActionDispatch::BestStandardsSupport below.
75
- # The remaining stack is printed on rackup (for fun!).
76
- # Rails API has config.middleware.api_only! to get
77
- # rid of browser related middleware.
78
51
  config.middleware.delete Rack::Lock
79
52
  config.middleware.delete ActionDispatch::Flash
80
-
81
- # We need a secret token for session, cookies, etc.
82
53
  config.secret_token = "48837489qkuweoiuoqwehisuakshdjksadhaisdy78o34y138974xyqp9rmye8yrpiokeuioqwzyoiuxftoyqiuxrhm3iou1hrzmjk"
83
54
  config.secret_key_base = "2049671-96803948"
84
55
  end
@@ -90,9 +61,7 @@ end
90
61
 
91
62
  class MonkeyController < ActionController::API
92
63
  def hello
93
- #render :json => { :Response => "Hello API!"}.to_json
94
- # Work around for Rails beta issue with rendering json
95
- render :plain => { :Response => "Hello API!"}.to_json, content_type: 'application/json'
64
+ render :plain => {:Response => "Hello API!"}.to_json, content_type: 'application/json'
96
65
  end
97
66
 
98
67
  def error
@@ -1,6 +1,9 @@
1
1
  # Copyright (c) 2015 AppNeta, Inc.
2
2
  # All rights reserved.
3
3
 
4
+ # We configure and launch Sidekiq in a background
5
+ # thread here.
6
+ #
4
7
  require 'sidekiq/cli'
5
8
 
6
9
  TraceView.logger.info "[traceview/servers] Starting up background Sidekiq."
@@ -18,7 +21,6 @@ end
18
21
 
19
22
  TraceView.logger.debug "[traceview/servers] sidekiq #{arguments}"
20
23
 
21
- # Boot Sidekiq in a new thread
22
24
  Thread.new do
23
25
  system("OBOE_GEM_TEST=true sidekiq #{arguments}")
24
26
  end
@@ -1,6 +1,9 @@
1
1
  # Copyright (c) 2015 AppNeta, Inc.
2
2
  # All rights reserved.
3
3
 
4
+ # This file is used to initialize the background Sidekiq
5
+ # process launched in our test suite.
6
+ #
4
7
  ENV['BUNDLE_GEMFILE'] = Dir.pwd + "/gemfiles/libraries.gemfile"
5
8
 
6
9
  require 'rubygems'
@@ -56,6 +56,9 @@ class NoopTest < Minitest::Test
56
56
  end
57
57
 
58
58
  def test_method_profiling_doesnt_barf
59
+ # FIXME: Skip this because it screws up tests that follow this one
60
+ # We should put in a way to remove custom instrumentation from a running process.
61
+ skip
59
62
  TraceView::API.profile_method(Array, :sort)
60
63
 
61
64
  x = [1, 3, 2]
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.8.2
4
+ version: 3.8.3
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-06-09 00:00:00.000000000 Z
12
+ date: 2016-08-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json
@@ -207,6 +207,8 @@ files:
207
207
  - lib/traceview/util.rb
208
208
  - lib/traceview/version.rb
209
209
  - lib/traceview/xtrace.rb
210
+ - test/benchmarks/allocations_test.rb
211
+ - test/benchmarks/tracing_api_test.rb
210
212
  - test/frameworks/apps/grape_nested.rb
211
213
  - test/frameworks/apps/grape_simple.rb
212
214
  - test/frameworks/apps/padrino_simple.rb
@@ -358,6 +360,8 @@ test_files:
358
360
  - test/instrumentation/mongo_v1_test.rb
359
361
  - test/reporter/reporter_test.rb
360
362
  - test/models/widget.rb
363
+ - test/benchmarks/tracing_api_test.rb
364
+ - test/benchmarks/allocations_test.rb
361
365
  - test/profiling/method_profiling_test.rb
362
366
  - test/profiling/legacy_method_profiling_test.rb
363
367
  - test/frameworks/apps/grape_simple.rb