newrelic_rpm 3.6.0.74.beta → 3.6.0.78

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 (59) hide show
  1. data.tar.gz.sig +1 -2
  2. data/CHANGELOG +18 -0
  3. data/Gemfile +3 -3
  4. data/Rakefile +8 -0
  5. data/lib/new_relic/agent/agent.rb +4 -9
  6. data/lib/new_relic/agent/agent_logger.rb +1 -2
  7. data/lib/new_relic/agent/audit_logger.rb +7 -3
  8. data/lib/new_relic/agent/busy_calculator.rb +3 -3
  9. data/lib/new_relic/agent/configuration/server_source.rb +23 -10
  10. data/lib/new_relic/agent/cross_app_monitor.rb +1 -0
  11. data/lib/new_relic/agent/database.rb +2 -0
  12. data/lib/new_relic/agent/error_collector.rb +1 -1
  13. data/lib/new_relic/agent/instrumentation/active_record.rb +14 -13
  14. data/lib/new_relic/agent/instrumentation/active_record_helper.rb +72 -0
  15. data/lib/new_relic/agent/instrumentation/rails4/action_controller.rb +0 -76
  16. data/lib/new_relic/agent/instrumentation/rails4/action_view.rb +138 -0
  17. data/lib/new_relic/agent/instrumentation/rails4/active_record.rb +108 -0
  18. data/lib/new_relic/agent/null_logger.rb +15 -0
  19. data/lib/new_relic/agent/stats.rb +1 -0
  20. data/lib/new_relic/agent/stats_engine/transactions.rb +4 -4
  21. data/lib/new_relic/control/frameworks/rails.rb +0 -37
  22. data/lib/new_relic/control/frameworks/rails3.rb +0 -17
  23. data/lib/new_relic/control/instance_methods.rb +1 -2
  24. data/lib/new_relic/environment_report.rb +159 -0
  25. data/lib/new_relic/helper.rb +4 -0
  26. data/lib/new_relic/local_environment.rb +0 -161
  27. data/lib/newrelic_rpm.rb +1 -1
  28. data/test/multiverse/lib/multiverse/suite.rb +7 -0
  29. data/test/multiverse/suites/active_record/Envfile +0 -1
  30. data/test/multiverse/suites/agent_only/key_transactions_test.rb +22 -12
  31. data/test/multiverse/suites/rails/Envfile +8 -1
  32. data/test/multiverse/suites/rails/app.rb +7 -2
  33. data/test/multiverse/suites/rails/error_tracing_test.rb +28 -16
  34. data/test/multiverse/suites/rails/view_instrumentation_test.rb +8 -2
  35. data/test/new_relic/agent/agent/connect_test.rb +5 -8
  36. data/test/new_relic/agent/agent/start_test.rb +3 -1
  37. data/test/new_relic/agent/agent_logger_test.rb +8 -8
  38. data/test/new_relic/agent/agent_test.rb +0 -6
  39. data/test/new_relic/agent/agent_test_controller_test.rb +18 -14
  40. data/test/new_relic/agent/audit_logger_test.rb +12 -0
  41. data/test/new_relic/agent/configuration/server_source_test.rb +48 -0
  42. data/test/new_relic/agent/cross_app_monitor_test.rb +8 -0
  43. data/test/new_relic/agent/instrumentation/action_view_subscriber_test.rb +254 -0
  44. data/test/new_relic/agent/instrumentation/active_record_helper_test.rb +52 -0
  45. data/test/new_relic/agent/instrumentation/active_record_instrumentation_test.rb +32 -51
  46. data/test/new_relic/agent/instrumentation/active_record_subscriber_test.rb +132 -0
  47. data/test/new_relic/agent/instrumentation/net_instrumentation_test.rb +20 -0
  48. data/test/new_relic/agent_test.rb +0 -8
  49. data/test/new_relic/control_test.rb +1 -2
  50. data/test/new_relic/dispatcher_test.rb +1 -5
  51. data/test/new_relic/environment_report_test.rb +89 -0
  52. data/test/new_relic/license_test.rb +1 -3
  53. data/test/new_relic/load_test.rb +5 -1
  54. data/test/new_relic/local_environment_test.rb +0 -27
  55. data/test/new_relic/rack/browser_monitoring_test.rb +1 -0
  56. data/test/script/ci.sh +19 -18
  57. data/test/test_helper.rb +15 -3
  58. metadata +42 -3
  59. metadata.gz.sig +0 -0
@@ -81,12 +81,10 @@ class LicenseTest < Test::Unit::TestCase
81
81
  File.expand_path(__FILE__) == path ||
82
82
  # skip rpm_test_app and other stuff that ends up in tmp
83
83
  path.include?(gem_root + '/tmp/') ||
84
- # skip tags file
85
- path.include?(gem_root + '/tags')||
86
84
  # skip the auto-generated build.rb file
87
85
  path =~ %r{lib/new_relic/build\.rb} ||
88
86
  # skip tags file
89
- path =~ %r{/tags$}
87
+ path =~ %r{/tags$}i
90
88
  )
91
89
  end
92
90
 
@@ -5,7 +5,11 @@
5
5
  # require File.expand_path(File.join(File.dirname(__FILE__),'..','test_helper'))
6
6
  require 'test/unit'
7
7
  require 'resolv'
8
- require 'mocha'
8
+ begin
9
+ require 'mocha/setup'
10
+ rescue LoadError
11
+ require 'mocha'
12
+ end
9
13
 
10
14
  class LoadTest < Test::Unit::TestCase
11
15
  def test_loading_agent_when_disabled_does_not_resolv_addresses
@@ -51,33 +51,6 @@ class NewRelic::LocalEnvironmentTest < Test::Unit::TestCase
51
51
  Object.send(:remove_const, :PhusionPassenger)
52
52
  end
53
53
 
54
- def test_snapshot
55
- e = NewRelic::LocalEnvironment.new
56
- s = e.snapshot
57
- assert_equal 0, s.size
58
- e.gather_environment_info
59
- s = e.snapshot
60
- assert_match /1\.8\.[67]|1\.9\.|2\.0/, s.assoc('Ruby version').last, s.inspect
61
- assert_equal 'test', s.assoc('Framework').last, s.inspect
62
- # Make sure the processor count is determined on linux systems
63
- if File.exists? '/proc/cpuinfo'
64
- assert s.assoc('Processors').last.to_i > 0
65
- end
66
- end
67
-
68
- def test_gather_cpu_info_successful
69
- e = NewRelic::LocalEnvironment.new
70
- e.gather_cpu_info(File.expand_path(File.join(File.dirname(__FILE__),'..', 'fixtures', 'proc_cpuinfo.txt')))
71
- s = e.snapshot
72
- assert_equal 24, s.assoc('Processors').last.to_i
73
- end
74
-
75
- def test_gather_cpu_info_failure
76
- e = NewRelic::LocalEnvironment.new
77
- e.gather_cpu_info(File.expand_path(File.join(File.dirname(__FILE__),'..', 'test_helper.rb')))
78
- s = e.snapshot
79
- assert_equal 1, s.assoc('Processors').last.to_i
80
- end
81
54
 
82
55
  def test_default_port
83
56
  e = NewRelic::LocalEnvironment.new
@@ -5,6 +5,7 @@
5
5
  require File.expand_path(File.join(File.dirname(__FILE__),'..', '..',
6
6
  'test_helper'))
7
7
  require 'rack/test'
8
+ require 'new_relic/agent/instrumentation/rack'
8
9
  require 'new_relic/rack/browser_monitoring'
9
10
 
10
11
  ENV['RACK_ENV'] = 'test'
data/test/script/ci.sh CHANGED
@@ -6,16 +6,16 @@
6
6
  #
7
7
  # It relies on 2 environment variables:
8
8
  #
9
- # RUBY - The rbenv ruby you want to use (e.g. 1.8.7, ree, jruby)
9
+ # RUBY_VERSION - The rbenv ruby you want to use (e.g. 1.8.7, ree, jruby)
10
10
  #
11
11
  # BRANCH - The rpm_test_app branch you want to use (e.g. rails20, rails31)
12
12
  #
13
13
  # Example usage:
14
- # RUBY=ree BRANCH=rails20 test/script/ci.sh
14
+ # RUBY_VERSION=ree BRANCH=rails20 test/script/ci.sh
15
15
  #
16
- # RUBY=ree BRANCH=rails20 test/script/ci.sh
16
+ # RUBY_VERSION=ree BRANCH=rails20 test/script/ci.sh
17
17
  #
18
- # RUBY=jruby BRANCH=rails22 test/script/ci.sh
18
+ # RUBY_VERSION=jruby BRANCH=rails22 test/script/ci.sh
19
19
 
20
20
  echo "Executing $0"
21
21
  echo "Running in $(pwd)"
@@ -26,10 +26,10 @@ echo "Running in $(pwd)"
26
26
  set -e
27
27
 
28
28
  # check for require environment variables
29
- if [ "x$RUBY" == "x" ]; then
30
- echo '$RUBY is undefined'
29
+ if [ "x$RUBY_VERSION" == "x" ]; then
30
+ echo '$RUBY_VERSION is undefined'
31
31
  echo 'defaulting to 1.9.3'
32
- export RUBY=1.9.3-p374
32
+ export RUBY_VERSION=1.9.3-p374
33
33
  fi
34
34
  if [ "x$BRANCH" == "x" ]; then
35
35
  echo '$BRANCH is undefined'
@@ -42,22 +42,22 @@ if [ "x$JOB_NAME" == "x" ]; then
42
42
  echo 'defaulting to clrun'
43
43
  export PROJECT_NAME=clrun
44
44
  else
45
- CLEANSED_NAME=`echo $JOB_NAME | sed "s/label//" | sed "s/Portland//" | sed "s/BRANCH//" | sed "s/RUBY//" | sed "s/[=\/,\._]//g" | sed "s/ReleaseCandidate/RC/"`
45
+ CLEANSED_NAME=`echo $JOB_NAME | sed "s/label//" | sed "s/Portland//" | sed "s/BRANCH//" | sed "s/RUBY_VERSION//" | sed "s/[=\/,\._]//g" | sed "s/ReleaseCandidate/RC/"`
46
46
  echo "setting PROJECT_NAME to $CLEANSED_NAME"
47
47
  export PROJECT_NAME="$CLEANSED_NAME"
48
48
  fi
49
49
 
50
50
  eval "$(rbenv init -)" || true
51
- rbenv shell $RUBY
52
- if [ "x$(rbenv version-name)" = "x$RUBY" ]; then
53
- echo "switched to ruby $RUBY"
51
+ rbenv shell $RUBY_VERSION
52
+ if [ "x$(rbenv version-name)" = "x$RUBY_VERSION" ]; then
53
+ echo "switched to ruby $RUBY_VERSION"
54
54
  else
55
- rbenv install $RUBY
56
- rbenv shell $RUBY
57
- if [ "x$(rbenv version-name)" = "x$RUBY" ]; then
58
- echo "switched to ruby $RUBY"
55
+ rbenv install $RUBY_VERSION
56
+ rbenv shell $RUBY_VERSION
57
+ if [ "x$(rbenv version-name)" = "x$RUBY_VERSION" ]; then
58
+ echo "switched to ruby $RUBY_VERSION"
59
59
  else
60
- echo "failed to install ruby $RUBY"
60
+ echo "failed to install ruby $RUBY_VERSION"
61
61
  exit 1
62
62
  fi
63
63
  fi
@@ -93,7 +93,7 @@ cd rpm_test_app
93
93
  git fetch || true
94
94
  git checkout -t origin/$BRANCH || git checkout $BRANCH
95
95
  if [ -x $HOME/.rbenv/plugins/rbenv-gemsets ]; then
96
- echo "$RUBY-$BRANCH" > .rbenv-gemsets
96
+ echo "$RUBY_VERSION-$BRANCH" > .rbenv-gemsets
97
97
  fi
98
98
 
99
99
  # Re-write database.yml to this here doc
@@ -144,13 +144,14 @@ else
144
144
  perl -p -i'.bak' -e 's#gem .newrelic_rpm.*$#gem "newrelic_rpm", :path => "\.\.\/\.\.\/"#' Gemfile
145
145
  fi
146
146
 
147
- if [ "x$RUBY" == "x1.8.6" ]; then
147
+ if [ "x$RUBY_VERSION" == "x1.8.6" ]; then
148
148
  # Bundler 1.1 dropped support for ruby 1.8.6
149
149
  bundle -h > /dev/null || gem install bundler -v'~>1.0.0' --no-rdoc --no-ri
150
150
  else
151
151
  bundle -h > /dev/null || gem install bundler --no-rdoc --no-ri
152
152
  fi
153
153
 
154
+ bundle -v
154
155
 
155
156
  export RAILS_ENV=test
156
157
  bundle --local || bundle
data/test/test_helper.rb CHANGED
@@ -21,10 +21,18 @@ require 'rake'
21
21
  begin
22
22
  require 'config/environment'
23
23
  # require File.join(File.dirname(__FILE__),'..','..','rpm_test_app','config','environment')
24
+
25
+ # we need 'rails/test_help' for Rails 4
26
+ # we need 'test_help' for Rails 2
27
+ # we need neither for Rails 3
24
28
  begin
25
- require 'test_help'
29
+ require 'rails/test_help'
26
30
  rescue LoadError
27
- # ignore load problems on test help - it doesn't exist in rails 3
31
+ begin
32
+ require 'test_help'
33
+ rescue LoadError
34
+ # ignore load problems on test help - it doesn't exist in rails 3
35
+ end
28
36
  end
29
37
  require 'newrelic_rpm'
30
38
  rescue LoadError => e
@@ -48,7 +56,11 @@ end
48
56
 
49
57
  require 'test/unit'
50
58
  require 'shoulda'
51
- require 'mocha'
59
+ begin
60
+ require 'mocha/setup'
61
+ rescue LoadError
62
+ require 'mocha'
63
+ end
52
64
 
53
65
  begin # 1.8.6
54
66
  require 'mocha/integration/test_unit'
metadata CHANGED
@@ -1,8 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: newrelic_rpm
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.6.0.74.beta
5
- prerelease: 9
4
+ version: 3.6.0.78
5
+ prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Jason Clark
@@ -41,7 +41,7 @@ cert_chain:
41
41
  cHUySWFQWE92bTNUOEc0TzZxWnZobkxoL1VpZW4rK0RqOGVGQmVjVFBvTThw
42
42
  VmpLM3BoNQpuL0V3dVpDY0U2Z2h0Q0NNCi0tLS0tRU5EIENFUlRJRklDQVRF
43
43
  LS0tLS0K
44
- date: 2013-03-04 00:00:00.000000000 Z
44
+ date: 2013-03-19 00:00:00.000000000 Z
45
45
  dependencies: []
46
46
  description: ! 'New Relic is a performance management system, developed by New Relic,
47
47
 
@@ -114,6 +114,7 @@ files:
114
114
  - lib/new_relic/agent/instrumentation.rb
115
115
  - lib/new_relic/agent/instrumentation/active_merchant.rb
116
116
  - lib/new_relic/agent/instrumentation/active_record.rb
117
+ - lib/new_relic/agent/instrumentation/active_record_helper.rb
117
118
  - lib/new_relic/agent/instrumentation/acts_as_solr.rb
118
119
  - lib/new_relic/agent/instrumentation/authlogic.rb
119
120
  - lib/new_relic/agent/instrumentation/browser_monitoring_timings.rb
@@ -135,6 +136,8 @@ files:
135
136
  - lib/new_relic/agent/instrumentation/rails3/action_controller.rb
136
137
  - lib/new_relic/agent/instrumentation/rails3/errors.rb
137
138
  - lib/new_relic/agent/instrumentation/rails4/action_controller.rb
139
+ - lib/new_relic/agent/instrumentation/rails4/action_view.rb
140
+ - lib/new_relic/agent/instrumentation/rails4/active_record.rb
138
141
  - lib/new_relic/agent/instrumentation/rails4/errors.rb
139
142
  - lib/new_relic/agent/instrumentation/rainbows_instrumentation.rb
140
143
  - lib/new_relic/agent/instrumentation/resque.rb
@@ -144,6 +147,7 @@ files:
144
147
  - lib/new_relic/agent/instrumentation/unicorn_instrumentation.rb
145
148
  - lib/new_relic/agent/method_tracer.rb
146
149
  - lib/new_relic/agent/new_relic_service.rb
150
+ - lib/new_relic/agent/null_logger.rb
147
151
  - lib/new_relic/agent/pipe_channel_manager.rb
148
152
  - lib/new_relic/agent/pipe_service.rb
149
153
  - lib/new_relic/agent/rules_engine.rb
@@ -187,6 +191,7 @@ files:
187
191
  - lib/new_relic/control/profiling.rb
188
192
  - lib/new_relic/control/server_methods.rb
189
193
  - lib/new_relic/delayed_job_injection.rb
194
+ - lib/new_relic/environment_report.rb
190
195
  - lib/new_relic/helper.rb
191
196
  - lib/new_relic/language_support.rb
192
197
  - lib/new_relic/latest_changes.rb
@@ -328,7 +333,10 @@ files:
328
333
  - test/new_relic/agent/error_collector/notice_error_test.rb
329
334
  - test/new_relic/agent/error_collector_test.rb
330
335
  - test/new_relic/agent/event_listener_test.rb
336
+ - test/new_relic/agent/instrumentation/action_view_subscriber_test.rb
337
+ - test/new_relic/agent/instrumentation/active_record_helper_test.rb
331
338
  - test/new_relic/agent/instrumentation/active_record_instrumentation_test.rb
339
+ - test/new_relic/agent/instrumentation/active_record_subscriber_test.rb
332
340
  - test/new_relic/agent/instrumentation/browser_monitoring_timings_test.rb
333
341
  - test/new_relic/agent/instrumentation/controller_instrumentation_test.rb
334
342
  - test/new_relic/agent/instrumentation/instrumentation_test.rb
@@ -374,6 +382,7 @@ files:
374
382
  - test/new_relic/control_test.rb
375
383
  - test/new_relic/delayed_job_injection_test.rb
376
384
  - test/new_relic/dispatcher_test.rb
385
+ - test/new_relic/environment_report_test.rb
377
386
  - test/new_relic/fake_collector.rb
378
387
  - test/new_relic/framework_test.rb
379
388
  - test/new_relic/helper_test.rb
@@ -505,6 +514,26 @@ post_install_message: ! '
505
514
  similar to Resque and Delayed::Job tasks.
506
515
 
507
516
 
517
+ * Improved thread safety
518
+
519
+
520
+ The primary metrics data structures in the Ruby agent are now thread safe.
521
+
522
+ This should provide better reliability for the agent under JRuby and threaded
523
+
524
+ scenarios such as Sidekiq or Puma.
525
+
526
+
527
+ * More robust environment report
528
+
529
+
530
+ The agent''s analysis of the local environment (e.g. OS, Processors, loaded
531
+
532
+ gems) will now work in a wider variety of app environments, including
533
+
534
+ Sinatra.
535
+
536
+
508
537
  * Experimental Rainbows! support
509
538
 
510
539
 
@@ -518,6 +547,16 @@ post_install_message: ! '
518
547
  Thanks to Joseph Chen for the contribution.
519
548
 
520
549
 
550
+ * Fix a potential file descriptor leak in Resque instrumentation
551
+
552
+
553
+ A file descriptor leak that occurred when DontPerform exceptions were used to
554
+
555
+ abort processing of a job has been fixed. This should allow the Resque
556
+
557
+ instrumentation work correctly with the resque-lonely_job gem.
558
+
559
+
521
560
  See https://github.com/newrelic/rpm/blob/master/CHANGELOG for a full list of
522
561
 
523
562
  changes.
metadata.gz.sig CHANGED
Binary file