newrelic_rpm 3.6.7.159 → 3.6.8.164

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. data/CHANGELOG +14 -0
  2. data/lib/new_relic/agent/agent.rb +38 -35
  3. data/lib/new_relic/agent/agent_logger.rb +6 -47
  4. data/lib/new_relic/agent/beacon_configuration.rb +10 -4
  5. data/lib/new_relic/agent/browser_monitoring.rb +39 -33
  6. data/lib/new_relic/agent/commands/agent_command.rb +4 -4
  7. data/lib/new_relic/agent/commands/agent_command_router.rb +72 -10
  8. data/lib/new_relic/agent/commands/thread_profiler_session.rb +110 -0
  9. data/lib/new_relic/agent/commands/xray_session.rb +55 -0
  10. data/lib/new_relic/agent/commands/xray_session_collection.rb +158 -0
  11. data/lib/new_relic/agent/configuration/default_source.rb +61 -24
  12. data/lib/new_relic/agent/configuration/mask_defaults.rb +2 -2
  13. data/lib/new_relic/agent/configuration/server_source.rb +1 -1
  14. data/lib/new_relic/agent/instrumentation/action_controller_subscriber.rb +2 -0
  15. data/lib/new_relic/agent/instrumentation/controller_instrumentation.rb +4 -10
  16. data/lib/new_relic/agent/instrumentation/rails3/action_controller.rb +10 -11
  17. data/lib/new_relic/agent/memory_logger.rb +52 -0
  18. data/lib/new_relic/agent/new_relic_service.rb +4 -0
  19. data/lib/new_relic/agent/request_sampler.rb +32 -13
  20. data/lib/new_relic/agent/samplers/cpu_sampler.rb +6 -3
  21. data/lib/new_relic/agent/threading/agent_thread.rb +2 -1
  22. data/lib/new_relic/agent/threading/backtrace_node.rb +80 -27
  23. data/lib/new_relic/agent/threading/backtrace_service.rb +264 -0
  24. data/lib/new_relic/agent/threading/thread_profile.rb +79 -118
  25. data/lib/new_relic/agent/transaction/developer_mode_sample_buffer.rb +56 -0
  26. data/lib/new_relic/agent/transaction/force_persist_sample_buffer.rb +25 -0
  27. data/lib/new_relic/agent/transaction/slowest_sample_buffer.rb +25 -0
  28. data/lib/new_relic/agent/transaction/transaction_sample_buffer.rb +86 -0
  29. data/lib/new_relic/agent/transaction/xray_sample_buffer.rb +64 -0
  30. data/lib/new_relic/agent/transaction.rb +25 -4
  31. data/lib/new_relic/agent/transaction_sample_builder.rb +6 -10
  32. data/lib/new_relic/agent/transaction_sampler.rb +47 -202
  33. data/lib/new_relic/agent/worker_loop.rb +47 -39
  34. data/lib/new_relic/agent.rb +1 -1
  35. data/lib/new_relic/build.rb +2 -2
  36. data/lib/new_relic/coerce.rb +8 -0
  37. data/lib/new_relic/control/instance_methods.rb +1 -0
  38. data/lib/new_relic/rack/browser_monitoring.rb +15 -1
  39. data/lib/new_relic/rack/developer_mode.rb +1 -1
  40. data/lib/new_relic/transaction_sample.rb +20 -5
  41. data/lib/new_relic/version.rb +1 -1
  42. data/newrelic.yml +4 -6
  43. data/newrelic_rpm.gemspec +1 -1
  44. data/test/agent_helper.rb +11 -0
  45. data/test/environments/lib/environments/runner.rb +5 -1
  46. data/test/environments/rails21/Gemfile +2 -2
  47. data/test/environments/rails22/Gemfile +2 -2
  48. data/test/environments/rails23/Gemfile +2 -2
  49. data/test/environments/rails31/Gemfile +2 -2
  50. data/test/environments/rails32/Gemfile +2 -2
  51. data/test/multiverse/suites/agent_only/marshaling_test.rb +1 -1
  52. data/test/multiverse/suites/agent_only/testing_app.rb +6 -0
  53. data/test/multiverse/suites/agent_only/thread_profiling_test.rb +5 -5
  54. data/test/multiverse/suites/agent_only/xray_sessions_test.rb +163 -0
  55. data/test/multiverse/suites/rails/request_statistics_test.rb +2 -2
  56. data/test/multiverse/suites/rails/view_instrumentation_test.rb +20 -21
  57. data/test/new_relic/agent/agent/connect_test.rb +0 -10
  58. data/test/new_relic/agent/agent_test.rb +27 -44
  59. data/test/new_relic/agent/browser_monitoring_test.rb +0 -52
  60. data/test/new_relic/agent/commands/agent_command_router_test.rb +150 -12
  61. data/test/new_relic/agent/commands/{thread_profiler_test.rb → thread_profiler_session_test.rb} +58 -19
  62. data/test/new_relic/agent/commands/xray_session_collection_test.rb +332 -0
  63. data/test/new_relic/agent/commands/xray_session_test.rb +42 -0
  64. data/test/new_relic/agent/configuration/manager_test.rb +2 -1
  65. data/test/new_relic/agent/configuration/server_source_test.rb +10 -10
  66. data/test/new_relic/agent/cpu_sampler_test.rb +50 -0
  67. data/test/new_relic/agent/instrumentation/action_controller_subscriber_test.rb +31 -0
  68. data/test/new_relic/agent/instrumentation/queue_time_test.rb +0 -1
  69. data/test/new_relic/agent/instrumentation/sequel_test.rb +1 -1
  70. data/test/new_relic/agent/instrumentation/task_instrumentation_test.rb +0 -1
  71. data/test/new_relic/agent/memory_logger_test.rb +53 -0
  72. data/test/new_relic/agent/new_relic_service_test.rb +1 -1
  73. data/test/new_relic/agent/pipe_channel_manager_test.rb +4 -5
  74. data/test/new_relic/agent/request_sampler_test.rb +70 -20
  75. data/test/new_relic/agent/rules_engine_test.rb +6 -0
  76. data/test/new_relic/agent/threading/agent_thread_test.rb +2 -2
  77. data/test/new_relic/agent/threading/backtrace_node_test.rb +110 -17
  78. data/test/new_relic/agent/threading/backtrace_service_test.rb +567 -0
  79. data/test/new_relic/agent/threading/fake_thread.rb +4 -0
  80. data/test/new_relic/agent/threading/thread_profile_test.rb +141 -217
  81. data/test/new_relic/agent/threading/threaded_test_case.rb +3 -8
  82. data/test/new_relic/agent/transaction/developer_mode_sample_buffer_test.rb +69 -0
  83. data/test/new_relic/agent/transaction/force_persist_sample_buffer_test.rb +52 -0
  84. data/test/new_relic/agent/transaction/slowest_sample_buffer_test.rb +67 -0
  85. data/test/new_relic/agent/transaction/xray_sample_buffer_test.rb +71 -0
  86. data/test/new_relic/agent/transaction_sampler_test.rb +171 -307
  87. data/test/new_relic/agent/transaction_test.rb +33 -5
  88. data/test/new_relic/agent/worker_loop_test.rb +33 -11
  89. data/test/new_relic/coerce_test.rb +13 -0
  90. data/test/new_relic/fake_collector.rb +26 -3
  91. data/test/new_relic/multiverse_helpers.rb +2 -0
  92. data/test/new_relic/rack/browser_monitoring_test.rb +12 -0
  93. data/test/new_relic/rack/developer_mode_test.rb +2 -2
  94. data/test/new_relic/transaction_sample_test.rb +19 -2
  95. data/test/performance/lib/performance/console_reporter.rb +1 -1
  96. data/test/performance/lib/performance/test_case.rb +7 -3
  97. data/test/performance/script/runner +3 -0
  98. data/test/performance/suites/thread_profiling.rb +83 -0
  99. data/test/test_helper.rb +2 -2
  100. data.tar.gz.sig +0 -0
  101. metadata +32 -32
  102. metadata.gz.sig +1 -1
  103. data/lib/new_relic/agent/commands/thread_profiler.rb +0 -80
data/test/test_helper.rb CHANGED
@@ -229,7 +229,7 @@ module TransactionSampleTestHelper
229
229
  sampler.notice_pop_scope "a"
230
230
  sampler.notice_scope_empty(stub('txn', :name => '/path', :custom_parameters => {}))
231
231
 
232
- sampler.samples[0]
232
+ sampler.last_sample
233
233
  end
234
234
 
235
235
  def run_sample_trace_on(sampler, path='/path')
@@ -246,6 +246,6 @@ module TransactionSampleTestHelper
246
246
  sampler.notice_pop_scope "lew"
247
247
  sampler.notice_pop_scope "Controller/sandwiches/index"
248
248
  sampler.notice_scope_empty(stub('txn', :name => path, :custom_parameters => {}))
249
- sampler.samples[0]
249
+ sampler.last_sample
250
250
  end
251
251
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,13 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: newrelic_rpm
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.6.7.159
4
+ version: 3.6.8.164
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Jason Clark
9
9
  - Sam Goldstein
10
- - Michael Granger
11
10
  - Jonan Scheffler
12
11
  - Ben Weintraub
13
12
  autorequire:
@@ -41,7 +40,7 @@ cert_chain:
41
40
  cHUySWFQWE92bTNUOEc0TzZxWnZobkxoL1VpZW4rK0RqOGVGQmVjVFBvTThw
42
41
  VmpLM3BoNQpuL0V3dVpDY0U2Z2h0Q0NNCi0tLS0tRU5EIENFUlRJRklDQVRF
43
42
  LS0tLS0K
44
- date: 2013-09-23 00:00:00.000000000 Z
43
+ date: 2013-10-08 00:00:00.000000000 Z
45
44
  dependencies:
46
45
  - !ruby/object:Gem::Dependency
47
46
  name: rake
@@ -298,7 +297,9 @@ files:
298
297
  - lib/new_relic/agent/chained_call.rb
299
298
  - lib/new_relic/agent/commands/agent_command.rb
300
299
  - lib/new_relic/agent/commands/agent_command_router.rb
301
- - lib/new_relic/agent/commands/thread_profiler.rb
300
+ - lib/new_relic/agent/commands/thread_profiler_session.rb
301
+ - lib/new_relic/agent/commands/xray_session.rb
302
+ - lib/new_relic/agent/commands/xray_session_collection.rb
302
303
  - lib/new_relic/agent/configuration.rb
303
304
  - lib/new_relic/agent/configuration/default_source.rb
304
305
  - lib/new_relic/agent/configuration/environment_source.rb
@@ -365,6 +366,7 @@ files:
365
366
  - lib/new_relic/agent/instrumentation/typhoeus.rb
366
367
  - lib/new_relic/agent/instrumentation/unicorn_instrumentation.rb
367
368
  - lib/new_relic/agent/internal_agent_error.rb
369
+ - lib/new_relic/agent/memory_logger.rb
368
370
  - lib/new_relic/agent/method_tracer.rb
369
371
  - lib/new_relic/agent/new_relic_service.rb
370
372
  - lib/new_relic/agent/null_logger.rb
@@ -391,9 +393,15 @@ files:
391
393
  - lib/new_relic/agent/system_info.rb
392
394
  - lib/new_relic/agent/threading/agent_thread.rb
393
395
  - lib/new_relic/agent/threading/backtrace_node.rb
396
+ - lib/new_relic/agent/threading/backtrace_service.rb
394
397
  - lib/new_relic/agent/threading/thread_profile.rb
395
398
  - lib/new_relic/agent/transaction.rb
399
+ - lib/new_relic/agent/transaction/developer_mode_sample_buffer.rb
400
+ - lib/new_relic/agent/transaction/force_persist_sample_buffer.rb
396
401
  - lib/new_relic/agent/transaction/pop.rb
402
+ - lib/new_relic/agent/transaction/slowest_sample_buffer.rb
403
+ - lib/new_relic/agent/transaction/transaction_sample_buffer.rb
404
+ - lib/new_relic/agent/transaction/xray_sample_buffer.rb
397
405
  - lib/new_relic/agent/transaction_sample_builder.rb
398
406
  - lib/new_relic/agent/transaction_sampler.rb
399
407
  - lib/new_relic/agent/transaction_state.rb
@@ -564,6 +572,7 @@ files:
564
572
  - test/multiverse/suites/agent_only/start_up_test.rb
565
573
  - test/multiverse/suites/agent_only/testing_app.rb
566
574
  - test/multiverse/suites/agent_only/thread_profiling_test.rb
575
+ - test/multiverse/suites/agent_only/xray_sessions_test.rb
567
576
  - test/multiverse/suites/config_file_loading/Envfile
568
577
  - test/multiverse/suites/config_file_loading/config_file_loading_test.rb
569
578
  - test/multiverse/suites/curb/Envfile
@@ -656,12 +665,15 @@ files:
656
665
  - test/new_relic/agent/busy_calculator_test.rb
657
666
  - test/new_relic/agent/commands/agent_command_router_test.rb
658
667
  - test/new_relic/agent/commands/agent_command_test.rb
659
- - test/new_relic/agent/commands/thread_profiler_test.rb
668
+ - test/new_relic/agent/commands/thread_profiler_session_test.rb
669
+ - test/new_relic/agent/commands/xray_session_collection_test.rb
670
+ - test/new_relic/agent/commands/xray_session_test.rb
660
671
  - test/new_relic/agent/configuration/default_source_test.rb
661
672
  - test/new_relic/agent/configuration/environment_source_test.rb
662
673
  - test/new_relic/agent/configuration/manager_test.rb
663
674
  - test/new_relic/agent/configuration/server_source_test.rb
664
675
  - test/new_relic/agent/configuration/yaml_source_test.rb
676
+ - test/new_relic/agent/cpu_sampler_test.rb
665
677
  - test/new_relic/agent/cross_app_monitor_test.rb
666
678
  - test/new_relic/agent/database_test.rb
667
679
  - test/new_relic/agent/error_collector/notice_error_test.rb
@@ -684,6 +696,7 @@ files:
684
696
  - test/new_relic/agent/instrumentation/sinatra_test.rb
685
697
  - test/new_relic/agent/instrumentation/task_instrumentation_test.rb
686
698
  - test/new_relic/agent/memcache_instrumentation_test.rb
699
+ - test/new_relic/agent/memory_logger_test.rb
687
700
  - test/new_relic/agent/method_interrobang_test.rb
688
701
  - test/new_relic/agent/method_tracer/class_methods/add_method_tracer_test.rb
689
702
  - test/new_relic/agent/method_tracer/instance_methods/trace_execution_scoped_test.rb
@@ -709,10 +722,15 @@ files:
709
722
  - test/new_relic/agent/stats_test.rb
710
723
  - test/new_relic/agent/threading/agent_thread_test.rb
711
724
  - test/new_relic/agent/threading/backtrace_node_test.rb
725
+ - test/new_relic/agent/threading/backtrace_service_test.rb
712
726
  - test/new_relic/agent/threading/fake_thread.rb
713
727
  - test/new_relic/agent/threading/thread_profile_test.rb
714
728
  - test/new_relic/agent/threading/threaded_test_case.rb
729
+ - test/new_relic/agent/transaction/developer_mode_sample_buffer_test.rb
730
+ - test/new_relic/agent/transaction/force_persist_sample_buffer_test.rb
715
731
  - test/new_relic/agent/transaction/pop_test.rb
732
+ - test/new_relic/agent/transaction/slowest_sample_buffer_test.rb
733
+ - test/new_relic/agent/transaction/xray_sample_buffer_test.rb
716
734
  - test/new_relic/agent/transaction_interrobang_test.rb
717
735
  - test/new_relic/agent/transaction_sample_builder_test.rb
718
736
  - test/new_relic/agent/transaction_sampler_test.rb
@@ -781,6 +799,7 @@ files:
781
799
  - test/performance/script/runner
782
800
  - test/performance/suites/rum_autoinsertion.rb
783
801
  - test/performance/suites/startup.rb
802
+ - test/performance/suites/thread_profiling.rb
784
803
  - test/performance/suites/transaction_tracing.rb
785
804
  - test/rum/basic.result.html
786
805
  - test/rum/basic.source.html
@@ -905,33 +924,14 @@ files:
905
924
  - lib/new_relic/build.rb
906
925
  homepage: http://www.github.com/newrelic/rpm
907
926
  licenses: []
908
- post_install_message: ! "# New Relic Ruby Agent Release Notes #\n\n## v3.6.7 ##\n\n*
909
- Resque-pool support\n\n Resque processes started via the resque-pool gem weren't
910
- recognized by the\n Ruby agent. The agent now starts correctly in those worker
911
- processes.\n\n* Environment-based configuration\n\n All settings in newrelic.yml
912
- can now be configured via environment variables.\n See https://newrelic.com/docs/ruby/ruby-agent-configuration
913
- for full details.\n\n* Additional locking option for Resque (3.6.7.159)\n\n There
914
- have been reports of worker process deadlocks in Resque when using the\n Ruby agent.
915
- An optional lock is now available to avoid those deadlocks. See\n https://newrelic.com/docs/ruby/resque-instrumentation
916
- for more details.\n\n* HTTP connection setup timeout (3.6.7.159)\n\n HTTP initialization
917
- in the agent lacked an appropriate timeout,\n leading to dropouts in reporting
918
- under certain network error conditions.\n\n* Unnecessary requests from Resque jobs
919
- (3.6.7.159)\n\n An issue causing Resque jobs to unnecessarily make requests against
920
- New Relic\n servers was fixed.\n\n* Fix compatibility issues with excon and curb
921
- instrumentation\n\n This release of the agent fixes a warning seen under certain
922
- circumstances\n with the excon gem (most notably, when excon was used by fog),
923
- as well as\n a bug with the curb instrumentation that conflicted with the feedzirra
924
- gem.\n\n* Allow license key to be set by Capistrano variables\n\n A license key
925
- can be passed via a Capistrano variable where previously it\n could only be in
926
- newrelic.yml. Thanks Chris Marshall for the contribution!\n\n* Make HTTP client
927
- instrumentation aware of \"Host\" request header\n\n If a \"Host\" header is set
928
- explicitly on an HTTP request, that hostname will\n be used for external metrics.
929
- Thanks Mislav Marohnić for the contribution!\n\n* Fix ActiveSupport::Concern warnings
930
- with MethodTracer\n\n Including NewRelic::Agent::MethodTracer in a class using
931
- Concerns could cause\n deprecation warnings. Thanks Mike Połtyn for the contribution!\n\n*
932
- Fix Authlogic constant name\n\n Code checking for the Authlogic module was using
933
- in the wrong case. Thanks\n Dharam Gollapudi for the contribution!\n\nSee https://github.com/newrelic/rpm/blob/master/CHANGELOG
934
- for a full list of\nchanges.\n"
927
+ post_install_message: ! "# New Relic Ruby Agent Release Notes #\n\n## v3.6.8 ##\n\n*
928
+ X-Ray Sessions support\n\n X-Ray Sessions provide more targeted transaction trace
929
+ samples and thread\n profiling for web transactions. For full details see our X-Ray
930
+ sessions\n documentation at https://newrelic.com/docs/site/xray-sessions.\n\n*
931
+ CPU metrics re-enabled for JRuby >= 1.7.0\n\n To work around a JRuby bug, the Ruby
932
+ agent stopped gathering CPU metrics on\n that platform. With the bug fixed, the
933
+ agent can gather those metrics again.\n Thanks Bram de Vries for the contribution!\n\nSee
934
+ https://github.com/newrelic/rpm/blob/master/CHANGELOG for a full list of\nchanges.\n"
935
935
  rdoc_options:
936
936
  - --line-numbers
937
937
  - --inline-source
metadata.gz.sig CHANGED
@@ -1 +1 @@
1
- �X3q��OG��v3>e ?Bk�쨇�7�ϖ���<�'k�KF�r|���첝�/'�)�����|/2�y™Eг�m���T��#�J�Mv�
1
+ a_��m|$}{[r�"o��l�p� �� �ߔ?7pX�}'.����𤋦�ܐsk!(��Ai|$%?�7>8��l�͋�]�|.\X8�;�Xu�ٻ9{U�@r��<�|��H3��sj�#{b��w��W��O����1
@@ -1,80 +0,0 @@
1
- # encoding: utf-8
2
- #k 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
- require 'new_relic/agent/threading/agent_thread'
6
- require 'new_relic/agent/threading/thread_profile'
7
-
8
- module NewRelic
9
- module Agent
10
- module Commands
11
-
12
- class ThreadProfiler
13
-
14
- def self.is_supported?
15
- RUBY_VERSION >= "1.9.2"
16
- end
17
-
18
- def handle_start_command(agent_command)
19
- raise_unsupported_error unless ThreadProfiler.is_supported?
20
- raise_already_started_error if running?
21
- start(agent_command)
22
- end
23
-
24
- def handle_stop_command(agent_command)
25
- report_data = agent_command.arguments.fetch("report_data", true)
26
- stop(report_data)
27
- end
28
-
29
- def start(agent_command)
30
- @profile = Threading::ThreadProfile.new(agent_command)
31
- @profile.run
32
- end
33
-
34
- def stop(report_data)
35
- @profile.stop unless @profile.nil?
36
- @profile = nil if !report_data
37
- end
38
-
39
- def harvest
40
- profile = @profile
41
- @profile = nil
42
- profile
43
- end
44
-
45
- def running?
46
- !@profile.nil?
47
- end
48
-
49
- def finished?
50
- @profile && @profile.finished?
51
- end
52
-
53
- private
54
-
55
- def raise_command_error(msg)
56
- NewRelic::Agent.logger.debug(msg)
57
- raise NewRelic::Agent::Commands::AgentCommandRouter::AgentCommandError.new(msg)
58
- end
59
-
60
- def raise_already_started_error
61
- msg = "Profile already in progress. Ignoring agent command to start another."
62
- raise_command_error(msg)
63
- end
64
-
65
- def raise_unsupported_error
66
- msg = <<-EOF
67
- Thread profiling is only supported on 1.9.2 and greater versions of Ruby.
68
- We detected running agents capable of profiling, but the profile started with
69
- an agent running Ruby #{RUBY_VERSION}.
70
-
71
- Profiling again might select an appropriate agent, but we recommend running a
72
- consistent version of Ruby across your application for better results.
73
- EOF
74
- raise_command_error(msg)
75
- end
76
-
77
- end
78
- end
79
- end
80
- end