newrelic_rpm 3.6.8.168 → 3.6.9.171
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +0 -0
- data/.gitignore +1 -0
- data/.yardopts +17 -0
- data/CHANGELOG +48 -0
- data/README.md +8 -6
- data/lib/new_relic/agent.rb +65 -17
- data/lib/new_relic/agent/agent.rb +42 -113
- data/lib/new_relic/agent/browser_monitoring.rb +9 -1
- data/lib/new_relic/agent/configuration/default_source.rb +12 -0
- data/lib/new_relic/agent/error_collector.rb +13 -6
- data/lib/new_relic/agent/instrumentation/active_record_subscriber.rb +5 -5
- data/lib/new_relic/agent/instrumentation/controller_instrumentation.rb +15 -0
- data/lib/new_relic/agent/instrumentation/curb.rb +2 -2
- data/lib/new_relic/agent/instrumentation/metric_frame.rb +2 -2
- data/lib/new_relic/agent/instrumentation/rack.rb +2 -0
- data/lib/new_relic/agent/instrumentation/resque.rb +9 -3
- data/lib/new_relic/agent/instrumentation/sidekiq.rb +5 -0
- data/lib/new_relic/agent/method_tracer.rb +45 -27
- data/lib/new_relic/agent/new_relic_service.rb +14 -6
- data/lib/new_relic/agent/pipe_service.rb +1 -1
- data/lib/new_relic/agent/request_sampler.rb +10 -7
- data/lib/new_relic/agent/rules_engine.rb +5 -0
- data/lib/new_relic/agent/samplers/object_sampler.rb +1 -1
- data/lib/new_relic/agent/sql_sampler.rb +4 -2
- data/lib/new_relic/agent/stats_engine.rb +3 -0
- data/lib/new_relic/agent/stats_engine/gc_profiler.rb +17 -7
- data/lib/new_relic/agent/stats_engine/metric_stats.rb +5 -7
- data/lib/new_relic/agent/stats_engine/stats_hash.rb +2 -0
- data/lib/new_relic/agent/supported_versions.rb +247 -0
- data/lib/new_relic/agent/threading/backtrace_service.rb +1 -1
- data/lib/new_relic/agent/threading/thread_profile.rb +2 -1
- data/lib/new_relic/agent/transaction.rb +7 -6
- data/lib/new_relic/agent/transaction/developer_mode_sample_buffer.rb +11 -5
- data/lib/new_relic/agent/transaction/force_persist_sample_buffer.rb +3 -3
- data/lib/new_relic/agent/transaction/slowest_sample_buffer.rb +3 -3
- data/lib/new_relic/agent/transaction/transaction_sample_buffer.rb +23 -4
- data/lib/new_relic/agent/transaction/xray_sample_buffer.rb +4 -4
- data/lib/new_relic/agent/transaction_sampler.rb +14 -18
- data/lib/new_relic/agent/worker_loop.rb +1 -0
- data/lib/new_relic/control.rb +1 -0
- data/lib/new_relic/control/instance_methods.rb +0 -1
- data/lib/new_relic/helper.rb +1 -2
- data/lib/new_relic/language_support.rb +12 -2
- data/lib/new_relic/local_environment.rb +12 -11
- data/lib/new_relic/rack.rb +9 -0
- data/lib/new_relic/rack/agent_hooks.rb +6 -0
- data/lib/new_relic/rack/browser_monitoring.rb +9 -2
- data/lib/new_relic/rack/developer_mode.rb +15 -1
- data/lib/new_relic/rack/error_collector.rb +7 -0
- data/lib/new_relic/recipes.rb +2 -0
- data/lib/new_relic/transaction_sample.rb +39 -48
- data/lib/new_relic/version.rb +1 -1
- data/lib/tasks/install.rake +44 -2
- data/lib/tasks/versions.html.erb +31 -0
- data/lib/tasks/versions.rake +52 -0
- data/lib/tasks/versions.txt.erb +14 -0
- data/newrelic_rpm.gemspec +4 -2
- data/test/agent_helper.rb +21 -1
- data/test/environments/lib/environments/runner.rb +19 -5
- data/test/environments/norails/Gemfile +4 -1
- data/test/environments/rails21/Gemfile +4 -6
- data/test/environments/rails21/Rakefile +4 -0
- data/test/environments/rails21/config/database.yml +2 -7
- data/test/environments/rails22/Gemfile +6 -13
- data/test/environments/rails22/Rakefile +4 -0
- data/test/environments/rails22/config/database.yml +2 -7
- data/test/environments/rails22/config/environment.rb +1 -1
- data/test/environments/rails23/Gemfile +3 -4
- data/test/environments/rails23/Rakefile +4 -0
- data/test/environments/rails23/config/database.yml +2 -7
- data/test/environments/rails30/Gemfile +2 -4
- data/test/environments/rails30/Rakefile +2 -0
- data/test/environments/rails30/config/database.yml +2 -7
- data/test/environments/rails31/Gemfile +2 -4
- data/test/environments/rails31/Rakefile +2 -0
- data/test/environments/rails31/config/database.yml +2 -7
- data/test/environments/rails32/Gemfile +2 -5
- data/test/environments/rails32/Rakefile +2 -0
- data/test/environments/rails32/config/database.yml +1 -1
- data/test/environments/rails40/Gemfile +7 -4
- data/test/environments/rails40/Rakefile +2 -0
- data/test/environments/rails40/config/database.yml +2 -7
- data/test/helpers/runtime_detection.rb +17 -0
- data/test/multiverse/lib/multiverse/suite.rb +20 -4
- data/test/multiverse/suites/agent_only/key_transactions_test.rb +1 -1
- data/test/multiverse/suites/agent_only/marshaling_test.rb +1 -1
- data/test/multiverse/suites/agent_only/thread_profiling_test.rb +32 -7
- data/test/multiverse/suites/agent_only/xray_sessions_test.rb +1 -0
- data/test/multiverse/suites/config_file_loading/config_file_loading_test.rb +4 -3
- data/test/multiverse/suites/curb/curb_test.rb +8 -0
- data/test/multiverse/suites/excon/excon_test.rb +8 -0
- data/test/multiverse/suites/httpclient/httpclient_test.rb +8 -0
- data/test/multiverse/suites/net_http/net_http_test.rb +8 -0
- data/test/multiverse/suites/padrino/Envfile +3 -2
- data/test/multiverse/suites/rails/gc_instrumentation_test.rb +17 -8
- data/test/multiverse/suites/resque/Envfile +3 -3
- data/test/multiverse/suites/resque/instrumentation_test.rb +47 -5
- data/test/multiverse/suites/sequel/Envfile +0 -3
- data/test/multiverse/suites/sequel/database.rb +53 -0
- data/test/{new_relic/agent/instrumentation/sequel_test.rb → multiverse/suites/sequel/sequel_instrumentation_test.rb} +12 -53
- data/test/multiverse/suites/sequel/{sequel_test.rb → sequel_safety_test.rb} +2 -17
- data/test/multiverse/suites/sidekiq/sidekiq_instrumentation_test.rb +50 -5
- data/test/multiverse/suites/sinatra/sinatra_metric_explosion_test.rb +15 -2
- data/test/multiverse/suites/typhoeus/typhoeus_test.rb +8 -0
- data/test/new_relic/agent/agent/connect_test.rb +3 -2
- data/test/new_relic/agent/agent_test.rb +89 -82
- data/test/new_relic/agent/browser_monitoring_test.rb +44 -1
- data/test/new_relic/agent/error_collector_test.rb +17 -20
- data/test/new_relic/agent/instrumentation/active_record_instrumentation_test.rb +13 -10
- data/test/new_relic/agent/instrumentation/active_record_subscriber_test.rb +16 -1
- data/test/new_relic/agent/instrumentation/task_instrumentation_test.rb +2 -2
- data/test/new_relic/agent/method_tracer/instance_methods/trace_execution_scoped_test.rb +1 -1
- data/test/new_relic/agent/new_relic_service_test.rb +78 -9
- data/test/new_relic/agent/pipe_channel_manager_test.rb +7 -9
- data/test/new_relic/agent/pipe_service_test.rb +4 -4
- data/test/new_relic/agent/request_sampler_test.rb +2 -2
- data/test/new_relic/agent/stats_engine/gc_profiler_test.rb +15 -35
- data/test/new_relic/agent/stats_engine/metric_stats_test.rb +15 -7
- data/test/new_relic/agent/stats_engine_test.rb +4 -3
- data/test/new_relic/agent/threading/backtrace_service_test.rb +2 -0
- data/test/new_relic/agent/threading/thread_profile_test.rb +19 -0
- data/test/new_relic/agent/transaction/developer_mode_sample_buffer_test.rb +4 -4
- data/test/new_relic/agent/transaction/force_persist_sample_buffer_test.rb +1 -1
- data/test/new_relic/agent/transaction_sampler_test.rb +60 -45
- data/test/new_relic/fake_collector.rb +37 -2
- data/test/new_relic/http_client_test_cases.rb +26 -1
- data/test/new_relic/language_support_test.rb +12 -31
- data/test/new_relic/local_environment_test.rb +6 -2
- data/test/new_relic/multiverse_helpers.rb +2 -5
- data/test/new_relic/transaction_sample_test.rb +57 -36
- data/test/performance/suites/config.rb +76 -0
- data/test/rum/no_html_and_no_header.result.html +3 -0
- data/test/rum/no_html_and_no_header.source.html +3 -0
- data/test/script/ci.sh +0 -2
- data/test/test_helper.rb +5 -0
- metadata +43 -26
- metadata.gz.sig +0 -0
@@ -2,11 +2,12 @@ source 'https://rubygems.org'
|
|
2
2
|
|
3
3
|
gem "test-unit"
|
4
4
|
|
5
|
-
gem "rails", "~> 2.3.
|
5
|
+
gem "rails", "~> 2.3.18"
|
6
6
|
|
7
7
|
gem "mocha", "0.9.8"
|
8
8
|
gem 'rack'
|
9
9
|
gem 'rack-test'
|
10
|
+
gem 'rdoc'
|
10
11
|
|
11
12
|
gem "newrelic_rpm", :path => '../../..'
|
12
13
|
|
@@ -15,8 +16,6 @@ if(RUBY_PLATFORM == 'java')
|
|
15
16
|
gem "activerecord-jdbcsqlite3-adapter", "~>1.2.9"
|
16
17
|
gem "jruby-openssl"
|
17
18
|
else
|
18
|
-
gem "mysql",
|
19
|
+
gem "mysql", "~>2.9.1"
|
19
20
|
gem "sqlite3-ruby", "1.2.5"
|
20
21
|
end
|
21
|
-
|
22
|
-
gem 'sequel', '~> 3.46.0' unless RUBY_VERSION == '1.8.6'
|
@@ -5,8 +5,12 @@ require(File.join(File.dirname(__FILE__), 'config', 'boot'))
|
|
5
5
|
|
6
6
|
require 'rake'
|
7
7
|
require 'rake/testtask'
|
8
|
+
require 'rdoc/task'
|
8
9
|
|
9
10
|
gem 'newrelic_rpm'
|
11
|
+
|
12
|
+
require 'tasks/rails'
|
10
13
|
require 'tasks/all'
|
11
14
|
|
15
|
+
Rake::Task["default"].clear
|
12
16
|
task :default => [:'test:newrelic']
|
@@ -1,13 +1,10 @@
|
|
1
|
-
# Shared properties for mysql db
|
2
1
|
mysql: &mysql
|
3
2
|
adapter: mysql
|
4
3
|
socket: <%= (`uname -s` =~ /Linux/ ) ? "" :"/tmp/mysql.sock" %>
|
5
4
|
username: root
|
6
5
|
host: localhost
|
7
|
-
database: rails_blog
|
6
|
+
database: <%= db = "#{ENV['RUBY_VERSION']}#{ENV['BRANCH']}"; db.empty? ? "rails_blog" : db %>
|
8
7
|
|
9
|
-
# Shared properties for postgres. This won't work with our schema but
|
10
|
-
# Does work with agent tests
|
11
8
|
sqlite3: &sqlite3
|
12
9
|
<% if defined?(JRuby) %>
|
13
10
|
adapter: jdbcsqlite3
|
@@ -18,9 +15,7 @@ sqlite3: &sqlite3
|
|
18
15
|
pool: 5
|
19
16
|
timeout: 5000
|
20
17
|
host: localhost
|
21
|
-
|
22
|
-
# SQLite version 3.x
|
23
|
-
# gem install sqlite3-ruby (not necessary on OS X Leopard)
|
18
|
+
|
24
19
|
development:
|
25
20
|
<<: *sqlite3
|
26
21
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
source 'http://rubygems.org'
|
2
2
|
|
3
3
|
gem 'test-unit'
|
4
|
-
gem 'rails', '~>3.0.
|
4
|
+
gem 'rails', '~>3.0.20'
|
5
5
|
gem 'newrelic_rpm', :path => '../../..'
|
6
6
|
gem "mocha"
|
7
7
|
gem 'rack'
|
@@ -12,8 +12,6 @@ if (RUBY_PLATFORM == 'java')
|
|
12
12
|
gem "activerecord-jdbcsqlite3-adapter", '1.2.5'
|
13
13
|
gem "jruby-openssl"
|
14
14
|
else
|
15
|
-
gem "mysql"
|
15
|
+
gem "mysql", "~>2.9.1"
|
16
16
|
gem "sqlite3-ruby"
|
17
17
|
end
|
18
|
-
|
19
|
-
gem 'sequel', '~> 3.46.0'
|
@@ -1,13 +1,10 @@
|
|
1
|
-
# Shared properties for mysql db
|
2
1
|
mysql: &mysql
|
3
2
|
adapter: mysql
|
4
3
|
socket: <%= (`uname -s` =~ /Linux/ ) ? "" :"/tmp/mysql.sock" %>
|
5
4
|
username: root
|
6
5
|
host: localhost
|
7
|
-
database: rails_blog
|
6
|
+
database: <%= db = "#{ENV['RUBY_VERSION']}#{ENV['BRANCH']}"; db.empty? ? "rails_blog" : db %>
|
8
7
|
|
9
|
-
# Shared properties for postgres. This won't work with our schema but
|
10
|
-
# Does work with agent tests
|
11
8
|
sqlite3: &sqlite3
|
12
9
|
<% if defined?(JRuby) %>
|
13
10
|
adapter: jdbcsqlite3
|
@@ -18,9 +15,7 @@ sqlite3: &sqlite3
|
|
18
15
|
pool: 5
|
19
16
|
timeout: 5000
|
20
17
|
host: localhost
|
21
|
-
|
22
|
-
# SQLite version 3.x
|
23
|
-
# gem install sqlite3-ruby (not necessary on OS X Leopard)
|
18
|
+
|
24
19
|
development:
|
25
20
|
<<: *sqlite3
|
26
21
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
source 'http://rubygems.org'
|
2
2
|
|
3
3
|
gem 'test-unit'
|
4
|
-
gem 'rails', '~>3.1.
|
4
|
+
gem 'rails', '~>3.1.12'
|
5
5
|
gem 'newrelic_rpm', :path => '../../..'
|
6
6
|
gem "mocha"
|
7
7
|
gem 'rack'
|
@@ -12,8 +12,6 @@ if (RUBY_PLATFORM == 'java')
|
|
12
12
|
gem "activerecord-jdbcsqlite3-adapter", "~>1.2.9"
|
13
13
|
gem "jruby-openssl"
|
14
14
|
else
|
15
|
-
gem "mysql"
|
15
|
+
gem "mysql", "~>2.9.1"
|
16
16
|
gem "sqlite3-ruby"
|
17
17
|
end
|
18
|
-
|
19
|
-
gem 'sequel', '~> 3.46.0'
|
@@ -1,13 +1,10 @@
|
|
1
|
-
# Shared properties for mysql db
|
2
1
|
mysql: &mysql
|
3
2
|
adapter: mysql
|
4
3
|
socket: <%= (`uname -s` =~ /Linux/ ) ? "" :"/tmp/mysql.sock" %>
|
5
4
|
username: root
|
6
5
|
host: localhost
|
7
|
-
database: rails_blog
|
6
|
+
database: <%= db = "#{ENV['RUBY_VERSION']}#{ENV['BRANCH']}"; db.empty? ? "rails_blog" : db %>
|
8
7
|
|
9
|
-
# Shared properties for postgres. This won't work with our schema but
|
10
|
-
# Does work with agent tests
|
11
8
|
sqlite3: &sqlite3
|
12
9
|
<% if defined?(JRuby) %>
|
13
10
|
adapter: jdbcsqlite3
|
@@ -18,9 +15,7 @@ sqlite3: &sqlite3
|
|
18
15
|
pool: 5
|
19
16
|
timeout: 5000
|
20
17
|
host: localhost
|
21
|
-
|
22
|
-
# SQLite version 3.x
|
23
|
-
# gem install sqlite3-ruby (not necessary on OS X Leopard)
|
18
|
+
|
24
19
|
development:
|
25
20
|
<<: *sqlite3
|
26
21
|
|
@@ -2,7 +2,7 @@ source 'http://rubygems.org'
|
|
2
2
|
|
3
3
|
gem 'rake'
|
4
4
|
|
5
|
-
gem 'rails', '~>3.2.
|
5
|
+
gem 'rails', '~>3.2.15'
|
6
6
|
|
7
7
|
gem "mocha", '~>0.13.0', :require => false
|
8
8
|
gem 'rack'
|
@@ -15,11 +15,8 @@ platforms :jruby do
|
|
15
15
|
end
|
16
16
|
|
17
17
|
platforms :ruby, :rbx do
|
18
|
-
gem "mysql"
|
19
|
-
gem "sqlite3-ruby"
|
18
|
+
gem "mysql", "~>2.9.1"
|
20
19
|
gem "sqlite3"
|
21
20
|
end
|
22
21
|
|
23
|
-
gem 'sequel', '~> 3.46.0'
|
24
|
-
|
25
22
|
gem "newrelic_rpm", :path => "../../.."
|
@@ -4,7 +4,7 @@ mysql: &mysql
|
|
4
4
|
socket: <%= (`uname -s` =~ /Linux/ ) ? "" :"/tmp/mysql.sock" %>
|
5
5
|
username: root
|
6
6
|
host: localhost
|
7
|
-
database: rails_blog
|
7
|
+
database: <%= db = "#{ENV['RUBY_VERSION']}#{ENV['BRANCH']}"; db.empty? ? "rails_blog" : db %>
|
8
8
|
|
9
9
|
# Shared properties for postgres. This won't work with our schema but
|
10
10
|
# Does work with agent tests
|
@@ -2,15 +2,15 @@ source 'http://rubygems.org'
|
|
2
2
|
|
3
3
|
gem 'rake'
|
4
4
|
|
5
|
-
gem 'rails', '~>4.0.0
|
5
|
+
gem 'rails', '~>4.0.0'
|
6
6
|
|
7
7
|
gem "mocha", '~>0.13.0', :require => false
|
8
8
|
gem 'rack'
|
9
9
|
gem 'rack-test'
|
10
10
|
|
11
11
|
platforms :jruby do
|
12
|
-
gem "activerecord-jdbcmysql-adapter"
|
13
|
-
gem "activerecord-jdbcsqlite3-adapter"
|
12
|
+
gem "activerecord-jdbcmysql-adapter", "~>1.3.0"
|
13
|
+
gem "activerecord-jdbcsqlite3-adapter", "~>1.3.0"
|
14
14
|
gem "jruby-openssl"
|
15
15
|
end
|
16
16
|
|
@@ -20,6 +20,9 @@ platforms :mri_19, :mri_20, :rbx do
|
|
20
20
|
gem "sqlite3"
|
21
21
|
end
|
22
22
|
|
23
|
-
|
23
|
+
platforms :rbx do
|
24
|
+
gem "rubysl"
|
25
|
+
gem "racc" # https://github.com/rubinius/rubinius/issues/2632
|
26
|
+
end
|
24
27
|
|
25
28
|
gem "newrelic_rpm", :path => "../../.."
|
@@ -1,13 +1,10 @@
|
|
1
|
-
# Shared properties for mysql db
|
2
1
|
mysql: &mysql
|
3
2
|
adapter: mysql
|
4
3
|
socket: <%= (`uname -s` =~ /Linux/ ) ? "" :"/tmp/mysql.sock" %>
|
5
4
|
username: root
|
6
5
|
host: localhost
|
7
|
-
database: rails_blog
|
6
|
+
database: <%= db = "#{ENV['RUBY_VERSION']}#{ENV['BRANCH']}"; db.empty? ? "rails_blog" : db %>
|
8
7
|
|
9
|
-
# Shared properties for postgres. This won't work with our schema but
|
10
|
-
# Does work with agent tests
|
11
8
|
sqlite3: &sqlite3
|
12
9
|
<% if defined?(JRuby) %>
|
13
10
|
adapter: jdbcsqlite3
|
@@ -18,9 +15,7 @@ sqlite3: &sqlite3
|
|
18
15
|
pool: 5
|
19
16
|
timeout: 5000
|
20
17
|
host: localhost
|
21
|
-
|
22
|
-
# SQLite version 3.x
|
23
|
-
# gem install sqlite3-ruby (not necessary on OS X Leopard)
|
18
|
+
|
24
19
|
development:
|
25
20
|
<<: *sqlite3
|
26
21
|
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# This file is distributed under New Relic's license terms.
|
3
|
+
# See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.
|
4
|
+
|
5
|
+
module NewRelic
|
6
|
+
module TestHelpers
|
7
|
+
module RuntimeDetection
|
8
|
+
def rubinius?
|
9
|
+
defined?(RUBY_ENGINE) && RUBY_ENGINE == 'rbx'
|
10
|
+
end
|
11
|
+
|
12
|
+
def jruby?
|
13
|
+
defined?(JRuby)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -73,6 +73,8 @@ module Multiverse
|
|
73
73
|
f.puts jruby_openssl_line unless gemfile_text =~ /^\s*gem .jruby-openssl./
|
74
74
|
f.puts minitest_line unless gemfile_text =~ /^\s*gem .minitest[^_]./
|
75
75
|
|
76
|
+
rbx_gemfile_lines(f, gemfile_text)
|
77
|
+
|
76
78
|
# We currently pin usage of mocha at the 0.9.x line for compatibility
|
77
79
|
# 0.10.x had issues with the integration handlers and MiniTest on old Rubies
|
78
80
|
# 0.11.x introduced syntax that breaks 1.8.6 entirely :(
|
@@ -81,10 +83,13 @@ module Multiverse
|
|
81
83
|
# resolved in some fashion at that point
|
82
84
|
f.puts " gem 'mocha', '~> 0.9.8', :require => false" unless environments.omit_mocha
|
83
85
|
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
86
|
+
# Need to get Rubinius' debugger wired in, but MRI's doesn't work
|
87
|
+
if include_debugger
|
88
|
+
if RUBY_VERSION > '1.8.7'
|
89
|
+
f.puts " gem 'debugger', :platforms => [:mri]"
|
90
|
+
else
|
91
|
+
f.puts " gem 'ruby-debug', :platforms => [:mri]"
|
92
|
+
end
|
88
93
|
end
|
89
94
|
end
|
90
95
|
puts yellow("Gemfile.#{env_index} set to:") if verbose?
|
@@ -98,6 +103,17 @@ module Multiverse
|
|
98
103
|
line
|
99
104
|
end
|
100
105
|
|
106
|
+
def rbx_gemfile_lines(f, gemfile_text)
|
107
|
+
return unless is_rbx?
|
108
|
+
|
109
|
+
f.puts "gem 'rubysl', :platforms => [:rbx]" unless gemfile_text =~ /^\s*gem .rubysl./
|
110
|
+
f.puts "gem 'racc', :platforms => [:rbx]" unless gemfile_text =~ /^\s*gem .racc./
|
111
|
+
end
|
112
|
+
|
113
|
+
def is_rbx?
|
114
|
+
defined?(RUBY_ENGINE) && RUBY_ENGINE == "rbx"
|
115
|
+
end
|
116
|
+
|
101
117
|
def jruby_openssl_line
|
102
118
|
"gem 'jruby-openssl', :require => false, :platforms => [:jruby]"
|
103
119
|
end
|
@@ -62,7 +62,7 @@ class KeyTransactionsTest < MiniTest::Unit::TestCase
|
|
62
62
|
TestWidget.new.key_txn
|
63
63
|
TestWidget.new.other_txn
|
64
64
|
|
65
|
-
NewRelic::Agent.instance.send(:
|
65
|
+
NewRelic::Agent.instance.send(:harvest_and_send_transaction_traces)
|
66
66
|
|
67
67
|
traces = $collector.calls_for('transaction_sample_data')
|
68
68
|
assert_equal 1, traces.size
|
@@ -31,7 +31,7 @@ class MarshalingTest < MiniTest::Unit::TestCase
|
|
31
31
|
expected_sample = sampler.last_sample
|
32
32
|
|
33
33
|
agent.service.connect
|
34
|
-
agent.send(:
|
34
|
+
agent.send(:harvest_and_send_transaction_traces)
|
35
35
|
|
36
36
|
if NewRelic::Agent::NewRelicService::JsonMarshaller.is_supported?
|
37
37
|
marshaller = NewRelic::Agent::NewRelicService::JsonMarshaller.new
|
@@ -77,11 +77,33 @@ class ThreadProfilingTest < MiniTest::Unit::TestCase
|
|
77
77
|
assert_saw_traces(profile_data, "BACKGROUND")
|
78
78
|
end
|
79
79
|
|
80
|
+
def test_thread_profiling_with_pruby_marshaller
|
81
|
+
with_config(:marshaller => 'pruby') do
|
82
|
+
issue_command(START_COMMAND)
|
83
|
+
|
84
|
+
run_thread { NewRelic::Agent::Transaction.start(:controller, :request => stub) }
|
85
|
+
run_thread { NewRelic::Agent::Transaction.start(:task) }
|
86
|
+
|
87
|
+
let_it_finish
|
88
|
+
end
|
89
|
+
|
90
|
+
profile_data = $collector.calls_for('profile_data')[0]
|
91
|
+
assert_equal('666', profile_data.run_id, "Missing run_id, profile_data was #{profile_data.inspect}")
|
92
|
+
assert(profile_data.sample_count > 10, "Expected sample_count > 10, but was #{profile_data.sample_count}")
|
93
|
+
|
94
|
+
assert_saw_traces(profile_data, "OTHER")
|
95
|
+
assert_saw_traces(profile_data, "AGENT")
|
96
|
+
assert_saw_traces(profile_data, "REQUEST")
|
97
|
+
assert_saw_traces(profile_data, "BACKGROUND")
|
98
|
+
end
|
99
|
+
|
80
100
|
def test_thread_profiling_can_stop
|
81
101
|
issue_command(START_COMMAND)
|
82
102
|
issue_command(STOP_COMMAND)
|
83
103
|
|
84
|
-
|
104
|
+
# No wait needed, should be immediately ready to harvest
|
105
|
+
assert @thread_profiler_session.ready_to_harvest?
|
106
|
+
harvest
|
85
107
|
|
86
108
|
profile_data = $collector.calls_for('profile_data')[0]
|
87
109
|
assert_equal('666', profile_data.run_id, "Missing run_id, profile_data was #{profile_data.inspect}")
|
@@ -102,17 +124,20 @@ class ThreadProfilingTest < MiniTest::Unit::TestCase
|
|
102
124
|
end
|
103
125
|
|
104
126
|
def let_it_finish
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
end
|
109
|
-
end
|
127
|
+
wait_for_backtrace_service_poll(:timeout => 10.0, :iterations => 10)
|
128
|
+
harvest
|
129
|
+
end
|
110
130
|
|
131
|
+
def harvest
|
111
132
|
agent.send(:transmit_data, true)
|
112
133
|
end
|
113
134
|
|
114
135
|
def assert_saw_traces(profile_data, type)
|
115
|
-
|
136
|
+
assert_kind_of Hash, profile_data.traces
|
137
|
+
traces_for_type = profile_data.traces[type]
|
138
|
+
assert traces_for_type, "Missing key for type #{type} in profile_data"
|
139
|
+
assert_kind_of Array, traces_for_type
|
140
|
+
assert !profile_data.traces[type].empty?, "Zero #{type} traces seen"
|
116
141
|
end
|
117
142
|
|
118
143
|
end
|
@@ -89,6 +89,7 @@ class XraySessionsTest < MiniTest::Unit::TestCase
|
|
89
89
|
def test_gathers_thread_profiles
|
90
90
|
session = build_xray_session('key_transaction_name' => 'Controller/Rack/A')
|
91
91
|
with_xray_sessions(session) do
|
92
|
+
wait_for_backtrace_service_poll
|
92
93
|
get '/?transaction_name=A&sleep=1'
|
93
94
|
trigger_harvest
|
94
95
|
end
|
@@ -33,13 +33,14 @@ class ConfigFileLoadingTest < MiniTest::Unit::TestCase
|
|
33
33
|
|
34
34
|
# Figure out where multiverse is in the real file system.
|
35
35
|
@cwd = Dir.pwd
|
36
|
+
|
37
|
+
# require the agent before we're in FakeFS so require doesn't hit the fake
|
38
|
+
require 'newrelic_rpm'
|
39
|
+
|
36
40
|
# Use a fake file system so we don't damage the real one.
|
37
41
|
FakeFS.activate!
|
38
42
|
FakeFS::FileSystem.clear
|
39
43
|
|
40
|
-
# require the agent after we're in FakeFS
|
41
|
-
require 'newrelic_rpm'
|
42
|
-
|
43
44
|
FileUtils.mkdir_p(@cwd)
|
44
45
|
end
|
45
46
|
|