traceview 3.0.2-java → 3.0.3-java

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.
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
@@ -1,3 +1,6 @@
1
+ # Copyright (c) 2015 AppNeta, Inc.
2
+ # All rights reserved.
3
+
1
4
  require 'minitest_helper'
2
5
 
3
6
  describe "Resque" do
@@ -1,3 +1,6 @@
1
+ # Copyright (c) 2015 AppNeta, Inc.
2
+ # All rights reserved.
3
+
1
4
  require 'minitest_helper'
2
5
 
3
6
  if RUBY_VERSION >= '1.9.3'
@@ -1,6 +1,9 @@
1
+ # Copyright (c) 2015 AppNeta, Inc.
2
+ # All rights reserved.
3
+
1
4
  require 'minitest_helper'
2
5
 
3
- unless defined?(JRUBY_VERSION)
6
+ if defined?(::Sequel) && !defined?(JRUBY_VERSION)
4
7
 
5
8
  if ENV.key?('TRAVIS_MYSQL_PASS')
6
9
  MYSQL2_DB = Sequel.connect("mysql2://root:#{ENV['TRAVIS_MYSQL_PASS']}@127.0.0.1:3306/travis_ci_test")
@@ -1,6 +1,9 @@
1
+ # Copyright (c) 2015 AppNeta, Inc.
2
+ # All rights reserved.
3
+
1
4
  require 'minitest_helper'
2
5
 
3
- unless defined?(JRUBY_VERSION)
6
+ if defined?(::Sequel) && !defined?(JRUBY_VERSION)
4
7
 
5
8
  if ENV.key?('TRAVIS_MYSQL_PASS')
6
9
  MYSQL_DB = Sequel.connect("mysql://root:#{ENV['TRAVIS_MYSQL_PASS']}@127.0.0.1:3306/travis_ci_test")
@@ -1,6 +1,9 @@
1
+ # Copyright (c) 2015 AppNeta, Inc.
2
+ # All rights reserved.
3
+
1
4
  require 'minitest_helper'
2
5
 
3
- unless defined?(JRUBY_VERSION)
6
+ if defined?(::Sequel) && !defined?(JRUBY_VERSION)
4
7
 
5
8
  if ENV.key?('TRAVIS_PSQL_PASS')
6
9
  PG_DB = Sequel.connect("postgres://postgres:#{ENV['TRAVIS_PSQL_PASS']}@127.0.0.1:5432/travis_ci_test")
@@ -1,7 +1,13 @@
1
+ # Copyright (c) 2015 AppNeta, Inc.
2
+ # All rights reserved.
3
+
4
+ require 'rubygems'
5
+ require 'bundler/setup'
1
6
  require "minitest/spec"
2
7
  require "minitest/autorun"
3
8
  require "minitest/reporters"
4
9
  require "minitest/debugger" if ENV['DEBUG']
10
+ require "sinatra"
5
11
 
6
12
  ENV["RACK_ENV"] = "test"
7
13
  ENV["TRACEVIEW_GEM_TEST"] = "true"
@@ -21,26 +27,37 @@ if defined?(JRUBY_VERSION)
21
27
  ENV['JAVA_OPTS'] = "-J-javaagent:/usr/local/tracelytics/tracelyticsagent.jar"
22
28
  end
23
29
 
24
- require 'rubygems'
25
- require 'bundler'
26
-
27
- # Preload memcache-client
28
- require 'memcache'
29
-
30
- Bundler.require(:default, :test)
31
-
32
30
  @trace_dir = "/tmp/"
33
31
  $trace_file = @trace_dir + "trace_output.bson"
34
32
 
33
+ Bundler.require(:default, :test)
34
+
35
35
  # Configure TraceView
36
36
  TraceView::Config[:verbose] = true
37
37
  TraceView::Config[:tracing_mode] = "always"
38
38
  TraceView::Config[:sample_rate] = 1000000
39
39
  TraceView.logger.level = Logger::DEBUG
40
40
 
41
+ # Pre-create test databases (see also .travis.yml)
42
+ # puts "Pre-creating test databases"
43
+ # puts %x{mysql -u root -e 'create database travis_ci_test;'}
44
+ # puts %x{psql -c 'create database travis_ci_test;' -U postgres}
45
+
41
46
  # Our background Rack-app for http client testing
42
47
  require "./test/servers/rackapp_8101"
43
48
 
49
+ # Conditionally load other background servers
50
+ # depending on what we're testing
51
+ #
52
+ case File.basename(ENV['BUNDLE_GEMFILE'])
53
+ when /rails4/
54
+ require "./test/servers/rails4x_8140"
55
+ when /rails3/
56
+ require "./test/servers/rails3x_8140"
57
+ when /frameworks/
58
+ when /libraries/
59
+ end
60
+
44
61
  ##
45
62
  # clear_all_traces
46
63
  #
@@ -1,3 +1,6 @@
1
+ # Copyright (c) 2015 AppNeta, Inc.
2
+ # All rights reserved.
3
+
1
4
  require 'minitest_helper'
2
5
 
3
6
  describe "TraceViewMethodProfiling" do
@@ -4,7 +4,7 @@
4
4
  require 'rack/handler/puma'
5
5
  require 'traceview/inst/rack'
6
6
 
7
- TraceView.logger.info "[oboe/info] Starting background utility rack app on localhost:8101."
7
+ TraceView.logger.info "[traceview/info] Starting background utility rack app on localhost:8101."
8
8
 
9
9
  Thread.new do
10
10
  app = Rack::Builder.new {
@@ -1,5 +1,5 @@
1
- # Don't change this file!
2
- # Configure your app in config/environment.rb and config/environments/*.rb
1
+ # Copyright (c) 2015 AppNeta, Inc.
2
+ # All rights reserved.
3
3
 
4
4
  RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
5
5
 
@@ -0,0 +1,78 @@
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
+ #
5
+ # Run this file with:
6
+ #
7
+ # bundle exec RAILS_ENV=production rackup -p 3000 -s thin
8
+ #
9
+ # And access:
10
+ #
11
+ # http://localhost:3000/hello/world
12
+ #
13
+ # The following lines should come as no surprise. Except by
14
+ # ActionController::Metal, it follows the same structure of
15
+ # config/application.rb, config/environment.rb and config.ru
16
+ # existing in any Rails 4 app. Here they are simply in one
17
+ # file and without the comments.
18
+ require "rails"
19
+ require "action_controller/railtie" # require more if needed
20
+ require 'rack/handler/puma'
21
+
22
+ TraceView.logger.info "[traceview/info] Starting background utility rails app on localhost:8140."
23
+
24
+ class Rails32MetalStack < Rails::Application
25
+ routes.append do
26
+ get "/hello/world" => "hello#world"
27
+ get "/hello/metal" => "ferro#world"
28
+ end
29
+
30
+ # Enable cache classes. Production style.
31
+ config.cache_classes = true
32
+ config.eager_load = false
33
+
34
+ # uncomment below to display errors
35
+ # config.consider_all_requests_local = true
36
+
37
+ # Here you could remove some middlewares, for example
38
+ # Rack::Lock, ActionDispatch::Flash and ActionDispatch::BestStandardsSupport below.
39
+ # The remaining stack is printed on rackup (for fun!).
40
+ # Rails API has config.middleware.api_only! to get
41
+ # rid of browser related middleware.
42
+ config.middleware.delete "Rack::Lock"
43
+ config.middleware.delete "ActionDispatch::Flash"
44
+ config.middleware.delete "ActionDispatch::BestStandardsSupport"
45
+
46
+ # We need a secret token for session, cookies, etc.
47
+ config.secret_token = "49837489qkuweoiuoqwehisuakshdjksadhaisdy78o34y138974xyqp9rmye8yrpiokeuioqwzyoiuxftoyqiuxrhm3iou1hrzmjk"
48
+ config.secret_key_base = "2048671-96803948"
49
+ end
50
+
51
+ #################################################
52
+ # Controllers
53
+ #################################################
54
+
55
+ class HelloController < ActionController::Base
56
+ def world
57
+ render :text => "Hello world!"
58
+ end
59
+ end
60
+
61
+ class FerroController < ActionController::Metal
62
+ include AbstractController::Rendering
63
+
64
+ def world
65
+ render :text => "Hello world!"
66
+ end
67
+
68
+ include TraceViewMethodProfiling
69
+ profile_method :world, 'world'
70
+ end
71
+
72
+ Rails32MetalStack.initialize!
73
+
74
+ Thread.new do
75
+ Rack::Handler::Puma.run(Rails32MetalStack.to_app, {:Host => '127.0.0.1', :Port => 8140})
76
+ end
77
+
78
+ sleep(2)
@@ -0,0 +1,78 @@
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
+ #
5
+ # Run this file with:
6
+ #
7
+ # bundle exec RAILS_ENV=production rackup -p 3000 -s thin
8
+ #
9
+ # And access:
10
+ #
11
+ # http://localhost:3000/hello/world
12
+ #
13
+ # The following lines should come as no surprise. Except by
14
+ # ActionController::Metal, it follows the same structure of
15
+ # config/application.rb, config/environment.rb and config.ru
16
+ # existing in any Rails 4 app. Here they are simply in one
17
+ # file and without the comments.
18
+ require "rails"
19
+ require "action_controller/railtie" # require more if needed
20
+ require 'rack/handler/puma'
21
+
22
+ TraceView.logger.info "[traceview/info] Starting background utility rails app on localhost:8140."
23
+
24
+ class Rails40MetalStack < Rails::Application
25
+ routes.append do
26
+ get "/hello/world" => "hello#world"
27
+ get "/hello/metal" => "ferro#world"
28
+ end
29
+
30
+ # Enable cache classes. Production style.
31
+ config.cache_classes = true
32
+ config.eager_load = false
33
+
34
+ # uncomment below to display errors
35
+ # config.consider_all_requests_local = true
36
+
37
+ # Here you could remove some middlewares, for example
38
+ # Rack::Lock, ActionDispatch::Flash and ActionDispatch::BestStandardsSupport below.
39
+ # The remaining stack is printed on rackup (for fun!).
40
+ # Rails API has config.middleware.api_only! to get
41
+ # rid of browser related middleware.
42
+ config.middleware.delete "Rack::Lock"
43
+ config.middleware.delete "ActionDispatch::Flash"
44
+ config.middleware.delete "ActionDispatch::BestStandardsSupport"
45
+
46
+ # We need a secret token for session, cookies, etc.
47
+ config.secret_token = "49837489qkuweoiuoqwehisuakshdjksadhaisdy78o34y138974xyqp9rmye8yrpiokeuioqwzyoiuxftoyqiuxrhm3iou1hrzmjk"
48
+ config.secret_key_base = "2048671-96803948"
49
+ end
50
+
51
+ #################################################
52
+ # Controllers
53
+ #################################################
54
+
55
+ class HelloController < ActionController::Base
56
+ def world
57
+ render :text => "Hello world!"
58
+ end
59
+ end
60
+
61
+ class FerroController < ActionController::Metal
62
+ include AbstractController::Rendering
63
+
64
+ def world
65
+ render :text => "Hello world!"
66
+ end
67
+
68
+ include TraceViewMethodProfiling
69
+ profile_method :world, 'world'
70
+ end
71
+
72
+ Rails40MetalStack.initialize!
73
+
74
+ Thread.new do
75
+ Rack::Handler::Puma.run(Rails40MetalStack.to_app, {:Host => '127.0.0.1', :Port => 8140})
76
+ end
77
+
78
+ sleep(2)
@@ -1,3 +1,6 @@
1
+ # Copyright (c) 2015 AppNeta, Inc.
2
+ # All rights reserved.
3
+
1
4
  require 'minitest_helper'
2
5
 
3
6
  describe "BackwardCompatibility" do
@@ -1,3 +1,6 @@
1
+ # Copyright (c) 2015 AppNeta, Inc.
2
+ # All rights reserved.
3
+
1
4
  require 'minitest_helper'
2
5
 
3
6
  describe "TraceView::Config" do
@@ -1,3 +1,6 @@
1
+ # Copyright (c) 2015 AppNeta, Inc.
2
+ # All rights reserved.
3
+
1
4
  require 'minitest_helper'
2
5
  require 'rack/test'
3
6
  require 'rack/lobster'
@@ -1,3 +1,6 @@
1
+ # Copyright (c) 2015 AppNeta, Inc.
2
+ # All rights reserved.
3
+
1
4
  require 'minitest_helper'
2
5
  require 'rack/test'
3
6
  require 'rack/lobster'
@@ -1,3 +1,6 @@
1
+ # Copyright (c) 2015 AppNeta, Inc.
2
+ # All rights reserved.
3
+
1
4
  require 'minitest_helper'
2
5
 
3
6
  class TVAliasTest < Minitest::Test
@@ -1,3 +1,6 @@
1
+ # Copyright (c) 2015 AppNeta, Inc.
2
+ # All rights reserved.
3
+
1
4
  require 'minitest_helper'
2
5
 
3
6
  describe "XTrace" do
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.0.2
4
+ version: 3.0.3
5
5
  platform: java
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: 2015-06-24 00:00:00.000000000 Z
12
+ date: 2015-06-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json
@@ -49,7 +49,6 @@ files:
49
49
  - .gitignore
50
50
  - .rubocop.yml
51
51
  - .travis.yml
52
- - Appraisals
53
52
  - CHANGELOG.md
54
53
  - CONFIG.md
55
54
  - Gemfile
@@ -72,8 +71,15 @@ files:
72
71
  - ext/oboe_metal/src/oboe.hpp
73
72
  - ext/oboe_metal/src/oboe_wrap.cxx
74
73
  - ext/oboe_metal/tests/test.rb
75
- - gemfiles/mongo.gemfile
76
- - gemfiles/moped.gemfile
74
+ - gemfiles/frameworks.gemfile
75
+ - gemfiles/libraries.gemfile
76
+ - gemfiles/rails23.gemfile
77
+ - gemfiles/rails30.gemfile
78
+ - gemfiles/rails31.gemfile
79
+ - gemfiles/rails32.gemfile
80
+ - gemfiles/rails40.gemfile
81
+ - gemfiles/rails41.gemfile
82
+ - gemfiles/rails42.gemfile
77
83
  - get_version.rb
78
84
  - init.rb
79
85
  - lib/joboe_metal.rb
@@ -147,6 +153,8 @@ files:
147
153
  - test/frameworks/grape_test.rb
148
154
  - test/frameworks/padrino_test.rb
149
155
  - test/frameworks/rails2x_test.rb
156
+ - test/frameworks/rails3x_test.rb
157
+ - test/frameworks/rails4x_test.rb
150
158
  - test/frameworks/sinatra_test.rb
151
159
  - test/instrumentation/cassandra_test.rb
152
160
  - test/instrumentation/dalli_test.rb
@@ -177,6 +185,8 @@ files:
177
185
  - test/profiling/method_test.rb
178
186
  - test/servers/rackapp_8101.rb
179
187
  - test/servers/rails2x_8140.rb
188
+ - test/servers/rails3x_8140.rb
189
+ - test/servers/rails4x_8140.rb
180
190
  - test/support/backcompat_test.rb
181
191
  - test/support/config_test.rb
182
192
  - test/support/dnt_test.rb
@@ -210,6 +220,8 @@ specification_version: 4
210
220
  summary: AppNeta TraceView performance instrumentation gem for Ruby
211
221
  test_files:
212
222
  - test/minitest_helper.rb
223
+ - test/servers/rails4x_8140.rb
224
+ - test/servers/rails3x_8140.rb
213
225
  - test/servers/rails2x_8140.rb
214
226
  - test/servers/rackapp_8101.rb
215
227
  - test/instrumentation/excon_test.rb
@@ -240,8 +252,10 @@ test_files:
240
252
  - test/profiling/method_test.rb
241
253
  - test/frameworks/sinatra_test.rb
242
254
  - test/frameworks/grape_test.rb
255
+ - test/frameworks/rails3x_test.rb
243
256
  - test/frameworks/padrino_test.rb
244
257
  - test/frameworks/rails2x_test.rb
258
+ - test/frameworks/rails4x_test.rb
245
259
  - test/frameworks/apps/grape_simple.rb
246
260
  - test/frameworks/apps/sinatra_simple.rb
247
261
  - test/frameworks/apps/padrino_simple.rb
data/Appraisals DELETED
@@ -1,10 +0,0 @@
1
-
2
- appraise "mongo" do
3
- gem 'mongo'
4
- end
5
-
6
- if RUBY_VERSION >= '1.9'
7
- appraise "moped" do
8
- gem 'moped', "~> 1.5"
9
- end
10
- end
@@ -1,33 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "dalli"
6
- gem "memcache-client"
7
- gem "memcached", "1.7.2"
8
- gem "cassandra"
9
- gem "mongo"
10
- gem "bson"
11
- gem "moped", "~> 1.5"
12
- gem "resque"
13
- gem "redis"
14
- gem "sinatra"
15
- gem "padrino", "0.12.0"
16
- gem "grape"
17
-
18
- group :development, :test do
19
- gem "minitest"
20
- gem "minitest-reporters"
21
- gem "rack-test"
22
- gem "appraisal"
23
- end
24
-
25
- group :development do
26
- gem "ruby-debug", :platform => :mri_18
27
- gem "debugger", :platform => :mri_19
28
- gem "byebug", :platforms => [:mri_20, :mri_21]
29
- gem "perftools.rb", :platforms => [:mri_20, :mri_21], :require => "perftools"
30
- gem "pry"
31
- end
32
-
33
- gemspec :name => "oboe", :path => "../"