traceview 3.0.2 → 3.0.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 +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
@@ -1,6 +1,9 @@
|
|
1
|
+
# Copyright (c) 2015 AppNeta, Inc.
|
2
|
+
# All rights reserved.
|
3
|
+
|
1
4
|
require 'minitest_helper'
|
2
5
|
|
3
|
-
|
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
|
-
|
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
|
-
|
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")
|
data/test/minitest_helper.rb
CHANGED
@@ -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
|
#
|
@@ -4,7 +4,7 @@
|
|
4
4
|
require 'rack/handler/puma'
|
5
5
|
require 'traceview/inst/rack'
|
6
6
|
|
7
|
-
TraceView.logger.info "[
|
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 {
|
@@ -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)
|
data/test/support/config_test.rb
CHANGED
data/test/support/dnt_test.rb
CHANGED
data/test/support/xtrace_test.rb
CHANGED
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.
|
4
|
+
version: 3.0.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: 2015-06-
|
12
|
+
date: 2015-06-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json
|
@@ -51,7 +51,6 @@ files:
|
|
51
51
|
- ".gitignore"
|
52
52
|
- ".rubocop.yml"
|
53
53
|
- ".travis.yml"
|
54
|
-
- Appraisals
|
55
54
|
- CHANGELOG.md
|
56
55
|
- CONFIG.md
|
57
56
|
- Gemfile
|
@@ -74,8 +73,15 @@ files:
|
|
74
73
|
- ext/oboe_metal/src/oboe.hpp
|
75
74
|
- ext/oboe_metal/src/oboe_wrap.cxx
|
76
75
|
- ext/oboe_metal/tests/test.rb
|
77
|
-
- gemfiles/
|
78
|
-
- gemfiles/
|
76
|
+
- gemfiles/frameworks.gemfile
|
77
|
+
- gemfiles/libraries.gemfile
|
78
|
+
- gemfiles/rails23.gemfile
|
79
|
+
- gemfiles/rails30.gemfile
|
80
|
+
- gemfiles/rails31.gemfile
|
81
|
+
- gemfiles/rails32.gemfile
|
82
|
+
- gemfiles/rails40.gemfile
|
83
|
+
- gemfiles/rails41.gemfile
|
84
|
+
- gemfiles/rails42.gemfile
|
79
85
|
- get_version.rb
|
80
86
|
- init.rb
|
81
87
|
- lib/joboe_metal.rb
|
@@ -149,6 +155,8 @@ files:
|
|
149
155
|
- test/frameworks/grape_test.rb
|
150
156
|
- test/frameworks/padrino_test.rb
|
151
157
|
- test/frameworks/rails2x_test.rb
|
158
|
+
- test/frameworks/rails3x_test.rb
|
159
|
+
- test/frameworks/rails4x_test.rb
|
152
160
|
- test/frameworks/sinatra_test.rb
|
153
161
|
- test/instrumentation/cassandra_test.rb
|
154
162
|
- test/instrumentation/dalli_test.rb
|
@@ -179,6 +187,8 @@ files:
|
|
179
187
|
- test/profiling/method_test.rb
|
180
188
|
- test/servers/rackapp_8101.rb
|
181
189
|
- test/servers/rails2x_8140.rb
|
190
|
+
- test/servers/rails3x_8140.rb
|
191
|
+
- test/servers/rails4x_8140.rb
|
182
192
|
- test/support/backcompat_test.rb
|
183
193
|
- test/support/config_test.rb
|
184
194
|
- test/support/dnt_test.rb
|
@@ -211,6 +221,8 @@ signing_key:
|
|
211
221
|
specification_version: 4
|
212
222
|
summary: AppNeta TraceView performance instrumentation gem for Ruby
|
213
223
|
test_files:
|
224
|
+
- test/servers/rails4x_8140.rb
|
225
|
+
- test/servers/rails3x_8140.rb
|
214
226
|
- test/servers/rails2x_8140.rb
|
215
227
|
- test/servers/rackapp_8101.rb
|
216
228
|
- test/instrumentation/excon_test.rb
|
@@ -245,8 +257,10 @@ test_files:
|
|
245
257
|
- test/frameworks/apps/grape_nested.rb
|
246
258
|
- test/frameworks/sinatra_test.rb
|
247
259
|
- test/frameworks/grape_test.rb
|
260
|
+
- test/frameworks/rails3x_test.rb
|
248
261
|
- test/frameworks/padrino_test.rb
|
249
262
|
- test/frameworks/rails2x_test.rb
|
263
|
+
- test/frameworks/rails4x_test.rb
|
250
264
|
- test/support/config_test.rb
|
251
265
|
- test/support/dnt_test.rb
|
252
266
|
- test/support/tvalias_test.rb
|
data/Appraisals
DELETED
data/gemfiles/mongo.gemfile
DELETED
@@ -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 => "../"
|