newrelic_rpm 3.7.0.177 → 3.7.1.180

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. data.tar.gz.sig +0 -0
  2. data/CHANGELOG +28 -1
  3. data/lib/new_relic/agent.rb +1 -2
  4. data/lib/new_relic/agent/agent.rb +28 -10
  5. data/lib/new_relic/agent/agent_logger.rb +4 -3
  6. data/lib/new_relic/agent/audit_logger.rb +5 -8
  7. data/lib/new_relic/agent/configuration/default_source.rb +24 -0
  8. data/lib/new_relic/agent/cross_app_tracing.rb +21 -15
  9. data/lib/new_relic/agent/datastores/mongo.rb +25 -0
  10. data/lib/new_relic/agent/datastores/mongo/metric_generator.rb +25 -0
  11. data/lib/new_relic/agent/datastores/mongo/metric_translator.rb +189 -0
  12. data/lib/new_relic/agent/datastores/mongo/obfuscator.rb +39 -0
  13. data/lib/new_relic/agent/datastores/mongo/statement_formatter.rb +52 -0
  14. data/lib/new_relic/agent/harvester.rb +55 -0
  15. data/lib/new_relic/agent/instrumentation/mongo.rb +139 -0
  16. data/lib/new_relic/agent/instrumentation/net.rb +6 -11
  17. data/lib/new_relic/agent/supported_versions.rb +9 -5
  18. data/lib/new_relic/agent/transaction_sampler.rb +4 -0
  19. data/lib/new_relic/version.rb +1 -1
  20. data/lib/tasks/versions.rake +1 -1
  21. data/test/agent_helper.rb +4 -0
  22. data/test/environments/norails/Gemfile +3 -0
  23. data/test/environments/rails40/Gemfile +5 -1
  24. data/test/flaky_proxy/Gemfile +3 -0
  25. data/test/flaky_proxy/README.md +82 -0
  26. data/test/flaky_proxy/lib/flaky_proxy.rb +22 -0
  27. data/test/flaky_proxy/lib/flaky_proxy/connection.rb +45 -0
  28. data/test/flaky_proxy/lib/flaky_proxy/http_message.rb +105 -0
  29. data/test/flaky_proxy/lib/flaky_proxy/proxy.rb +42 -0
  30. data/test/flaky_proxy/lib/flaky_proxy/rule.rb +75 -0
  31. data/test/flaky_proxy/lib/flaky_proxy/rule_set.rb +37 -0
  32. data/test/flaky_proxy/lib/flaky_proxy/server.rb +22 -0
  33. data/test/flaky_proxy/script/flaky_proxy +39 -0
  34. data/test/helpers/exceptions.rb +16 -0
  35. data/test/helpers/mongo_metric_builder.rb +29 -0
  36. data/test/multiverse/lib/multiverse/suite.rb +1 -0
  37. data/test/multiverse/suites/curb/curb_test.rb +0 -1
  38. data/test/multiverse/suites/deferred_instrumentation/sinatra_test.rb +4 -3
  39. data/test/multiverse/suites/excon/excon_test.rb +0 -1
  40. data/test/multiverse/suites/httpclient/httpclient_test.rb +0 -1
  41. data/test/multiverse/suites/mongo/Envfile +66 -0
  42. data/test/multiverse/suites/mongo/config/newrelic.yml +19 -0
  43. data/test/multiverse/suites/mongo/mongo_instrumentation_test.rb +418 -0
  44. data/test/multiverse/suites/mongo/mongo_unsupported_version_test.rb +36 -0
  45. data/test/multiverse/suites/net_http/net_http_test.rb +2 -4
  46. data/test/multiverse/suites/rails/Envfile +4 -4
  47. data/test/multiverse/suites/rails/config/newrelic.yml +1 -1
  48. data/test/multiverse/suites/rails/error_tracing_test.rb +7 -7
  49. data/test/multiverse/suites/sidekiq/Envfile +1 -1
  50. data/test/multiverse/suites/sidekiq/sidekiq_instrumentation_test.rb +0 -1
  51. data/test/multiverse/suites/sinatra/sinatra_classic_test.rb +5 -3
  52. data/test/multiverse/suites/sinatra/sinatra_modular_test.rb +5 -3
  53. data/test/multiverse/suites/typhoeus/typhoeus_test.rb +0 -1
  54. data/test/new_relic/agent/agent_logger_test.rb +9 -1
  55. data/test/new_relic/agent/agent_test.rb +66 -1
  56. data/test/new_relic/agent/agent_test_controller.rb +1 -2
  57. data/test/new_relic/agent/audit_logger_test.rb +12 -4
  58. data/test/new_relic/agent/configuration/orphan_configuration_test.rb +11 -2
  59. data/test/new_relic/agent/cpu_sampler_test.rb +1 -0
  60. data/test/new_relic/agent/cross_app_tracing_test.rb +60 -0
  61. data/test/new_relic/agent/datastores/mongo/metric_generator_test.rb +43 -0
  62. data/test/new_relic/agent/datastores/mongo/metric_translator_test.rb +301 -0
  63. data/test/new_relic/agent/datastores/mongo/obfuscator_test.rb +91 -0
  64. data/test/new_relic/agent/datastores/mongo/statement_formatter_test.rb +71 -0
  65. data/test/new_relic/agent/harvester_test.rb +85 -0
  66. data/test/new_relic/agent/transaction_sampler_test.rb +5 -0
  67. data/test/new_relic/agent/worker_loop_test.rb +3 -5
  68. data/test/new_relic/http_client_test_cases.rb +65 -81
  69. data/test/new_relic/noticed_error_test.rb +14 -16
  70. data/test/performance/lib/performance.rb +1 -0
  71. data/test/performance/lib/performance/console_reporter.rb +6 -2
  72. data/test/performance/lib/performance/instrumentor.rb +1 -15
  73. data/test/performance/lib/performance/platform.rb +35 -0
  74. data/test/performance/lib/performance/test_case.rb +16 -1
  75. data/test/performance/suites/marshalling.rb +73 -0
  76. metadata +48 -19
  77. metadata.gz.sig +1 -2
@@ -6,6 +6,7 @@ require 'logger'
6
6
 
7
7
  $: << File.expand_path(File.dirname(__FILE__))
8
8
 
9
+ require 'performance/platform'
9
10
  require 'performance/result'
10
11
  require 'performance/runner'
11
12
  require 'performance/test_case'
@@ -42,8 +42,12 @@ module Performance
42
42
  results.each do |failure|
43
43
  puts "FAILED: #{failure.identifier}"
44
44
  e = failure.exception
45
- puts "#{e['class']}: #{e['message']}"
46
- puts failure.exception['backtrace'].map { |l| " #{l}" }.join("\n")
45
+ if e
46
+ puts "#{e['class']}: #{e['message']}"
47
+ puts failure.exception['backtrace'].map { |l| " #{l}" }.join("\n")
48
+ else
49
+ puts "<No exception recorded>"
50
+ end
47
51
  end
48
52
  puts ''
49
53
  end
@@ -4,20 +4,6 @@
4
4
 
5
5
  module Performance
6
6
  module Instrumentation
7
- def self.current_platform_matches?(p)
8
- is_jruby = defined?(JRUBY_VERSION)
9
- is_ree = defined?(RUBY_DESCRIPTION) && RUBY_DESCRIPTION =~ /MBARI/
10
- case p
11
- when :jruby then is_jruby
12
- when :mri then !is_jruby
13
- when :ree then !is_jruby && is_ree
14
- when :mri_18 then !is_jruby && RUBY_VERSION =~ /^1\.8\./
15
- when :mri_19 then !is_jruby && RUBY_VERSION =~ /^1\.9\./
16
- when :mri_193 then !is_jruby && RUBY_VERSION =~ /^1\.9\.3/
17
- when :mri_20 then !is_jruby && RUBY_VERSION =~ /^2\.0\./
18
- end
19
- end
20
-
21
7
  def self.load_instrumentors
22
8
  dir = File.expand_path(File.join(File.dirname(__FILE__), 'instrumentation'))
23
9
  Dir.glob(File.join(dir, "*.rb")).each do |filename|
@@ -63,7 +49,7 @@ module Performance
63
49
  def self.supported?
64
50
  (
65
51
  @supported_platforms.nil? ||
66
- @supported_platforms.any? { |p| Instrumentation.current_platform_matches?(p) }
52
+ Platform.current.match_any?(@supported_platforms)
67
53
  )
68
54
  end
69
55
 
@@ -0,0 +1,35 @@
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 Performance
6
+ class Platform
7
+ def self.current
8
+ @current ||= self.new
9
+ end
10
+
11
+ def jruby?
12
+ defined?(JRUBY_VERSION)
13
+ end
14
+
15
+ def ree?
16
+ defined?(RUBY_DESCRIPTION) && RUBY_DESCRIPTION =~ /MBARI/
17
+ end
18
+
19
+ def match?(p)
20
+ case p
21
+ when :jruby then jruby?
22
+ when :mri then !jruby?
23
+ when :ree then !jruby? && ree?
24
+ when :mri_18 then !jruby? && RUBY_VERSION =~ /^1\.8\./
25
+ when :mri_19 then !jruby? && RUBY_VERSION =~ /^1\.9\./
26
+ when :mri_193 then !jruby? && RUBY_VERSION =~ /^1\.9\.3/
27
+ when :mri_20 then !jruby? && RUBY_VERSION =~ /^2\.0\./
28
+ end
29
+ end
30
+
31
+ def match_any?(platforms)
32
+ platforms.any? { |p| match?(p) }
33
+ end
34
+ end
35
+ end
@@ -26,6 +26,14 @@ module Performance
26
26
  def setup; end
27
27
  def teardown; end
28
28
 
29
+ def self.skip_test(test_method_name, options={})
30
+ skip_specifiers << [test_method_name, options]
31
+ end
32
+
33
+ def self.skip_specifiers
34
+ @skip_specifiers ||= []
35
+ end
36
+
29
37
  def on(event, &action)
30
38
  @callbacks[event] ||= []
31
39
  @callbacks[event] << action
@@ -38,7 +46,14 @@ module Performance
38
46
  end
39
47
 
40
48
  def runnable_test_methods
41
- self.methods.map { |m| m.to_s }.select { |m| m =~ /^test_/ }
49
+ results = self.methods.map(&:to_s).select { |m| m =~ /^test_/ }
50
+ self.class.skip_specifiers.each do |specifier|
51
+ method_name, options = *specifier
52
+ skipped_platforms = Array(options[:platforms])
53
+ skipped = Platform.current.match_any?(skipped_platforms)
54
+ results.delete(method_name.to_s) if skipped
55
+ end
56
+ results
42
57
  end
43
58
 
44
59
  def with_callbacks(name)
@@ -0,0 +1,73 @@
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
+ class Marshalling < Performance::TestCase
6
+ def setup
7
+ @payload = build_analytics_events_payload
8
+ @tt_payload = build_transaction_trace_payload
9
+ end
10
+
11
+ skip_test :test_basic_marshalling_json, :platforms => :mri_18
12
+
13
+ def test_basic_marshalling_json(timer)
14
+ marshaller = NewRelic::Agent::NewRelicService::JsonMarshaller.new
15
+ timer.measure do
16
+ (iterations / 100).times do
17
+ marshaller.dump(@payload)
18
+ marshaller.dump(@tt_payload)
19
+ end
20
+ end
21
+ end
22
+
23
+ def test_basic_marshalling_pruby(timer)
24
+ marshaller = NewRelic::Agent::NewRelicService::PrubyMarshaller.new
25
+ timer.measure do
26
+ (iterations / 100).times do
27
+ marshaller.dump(@payload)
28
+ marshaller.dump(@tt_payload)
29
+ end
30
+ end
31
+ end
32
+
33
+ # Build an object graph that approximates a transaction trace in structure
34
+ def build_transaction_trace_payload(depth=6)
35
+ root = []
36
+ fanout = depth
37
+ fanout.times do |i|
38
+ node = [
39
+ i * rand(10),
40
+ i * rand(10),
41
+ "This/Is/The/Name/Of/A/Transaction/Trace/Node/Depth/#{depth}/#{i}",
42
+ {
43
+ "sql" => "SELECT #{(0..100).to_a.join(",")}"
44
+ },
45
+ []
46
+ ]
47
+ node[-1] = build_transaction_trace_payload(depth-1) if depth > 0
48
+ root << node
49
+ end
50
+ root
51
+ end
52
+
53
+ # Build an object graph that approximates a large analytics_event_data payload
54
+ def build_analytics_events_payload
55
+ events = []
56
+ 1000.times do
57
+ event = {
58
+ :timestamp => Time.now.to_f,
59
+ :name => "Controller/foo/bar",
60
+ :type => "Transaction",
61
+ :duration => rand,
62
+ :webDuration => rand,
63
+ :databaseDuration => rand,
64
+ :gcCumulative => rand,
65
+ :color => 'blue-green',
66
+ :shape => 'squarish',
67
+ :texture => 'sort of lumpy like a bag of frozen peas'
68
+ }
69
+ events << [event]
70
+ end
71
+ [rand(1000000), events]
72
+ end
73
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: newrelic_rpm
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.7.0.177
4
+ version: 3.7.1.180
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -40,7 +40,7 @@ cert_chain:
40
40
  cHUySWFQWE92bTNUOEc0TzZxWnZobkxoL1VpZW4rK0RqOGVGQmVjVFBvTThw
41
41
  VmpLM3BoNQpuL0V3dVpDY0U2Z2h0Q0NNCi0tLS0tRU5EIENFUlRJRklDQVRF
42
42
  LS0tLS0K
43
- date: 2013-12-05 00:00:00.000000000 Z
43
+ date: 2013-12-19 00:00:00.000000000 Z
44
44
  dependencies:
45
45
  - !ruby/object:Gem::Dependency
46
46
  name: rake
@@ -309,8 +309,14 @@ files:
309
309
  - lib/new_relic/agent/cross_app_monitor.rb
310
310
  - lib/new_relic/agent/cross_app_tracing.rb
311
311
  - lib/new_relic/agent/database.rb
312
+ - lib/new_relic/agent/datastores/mongo.rb
313
+ - lib/new_relic/agent/datastores/mongo/metric_generator.rb
314
+ - lib/new_relic/agent/datastores/mongo/metric_translator.rb
315
+ - lib/new_relic/agent/datastores/mongo/obfuscator.rb
316
+ - lib/new_relic/agent/datastores/mongo/statement_formatter.rb
312
317
  - lib/new_relic/agent/error_collector.rb
313
318
  - lib/new_relic/agent/event_listener.rb
319
+ - lib/new_relic/agent/harvester.rb
314
320
  - lib/new_relic/agent/http_clients/curb_wrappers.rb
315
321
  - lib/new_relic/agent/http_clients/excon_wrappers.rb
316
322
  - lib/new_relic/agent/http_clients/httpclient_wrappers.rb
@@ -340,6 +346,7 @@ files:
340
346
  - lib/new_relic/agent/instrumentation/merb/controller.rb
341
347
  - lib/new_relic/agent/instrumentation/merb/errors.rb
342
348
  - lib/new_relic/agent/instrumentation/metric_frame.rb
349
+ - lib/new_relic/agent/instrumentation/mongo.rb
343
350
  - lib/new_relic/agent/instrumentation/net.rb
344
351
  - lib/new_relic/agent/instrumentation/padrino.rb
345
352
  - lib/new_relic/agent/instrumentation/passenger_instrumentation.rb
@@ -545,7 +552,19 @@ files:
545
552
  - test/environments/rails40/config/environment.rb
546
553
  - test/environments/rails40/db/schema.rb
547
554
  - test/fixtures/proc_cpuinfo.txt
555
+ - test/flaky_proxy/Gemfile
556
+ - test/flaky_proxy/README.md
557
+ - test/flaky_proxy/lib/flaky_proxy.rb
558
+ - test/flaky_proxy/lib/flaky_proxy/connection.rb
559
+ - test/flaky_proxy/lib/flaky_proxy/http_message.rb
560
+ - test/flaky_proxy/lib/flaky_proxy/proxy.rb
561
+ - test/flaky_proxy/lib/flaky_proxy/rule.rb
562
+ - test/flaky_proxy/lib/flaky_proxy/rule_set.rb
563
+ - test/flaky_proxy/lib/flaky_proxy/server.rb
564
+ - test/flaky_proxy/script/flaky_proxy
565
+ - test/helpers/exceptions.rb
548
566
  - test/helpers/file_searching.rb
567
+ - test/helpers/mongo_metric_builder.rb
549
568
  - test/helpers/runtime_detection.rb
550
569
  - test/intentional_fail.rb
551
570
  - test/multiverse/.gitignore
@@ -598,6 +617,10 @@ files:
598
617
  - test/multiverse/suites/httpclient/Envfile
599
618
  - test/multiverse/suites/httpclient/config/newrelic.yml
600
619
  - test/multiverse/suites/httpclient/httpclient_test.rb
620
+ - test/multiverse/suites/mongo/Envfile
621
+ - test/multiverse/suites/mongo/config/newrelic.yml
622
+ - test/multiverse/suites/mongo/mongo_instrumentation_test.rb
623
+ - test/multiverse/suites/mongo/mongo_unsupported_version_test.rb
601
624
  - test/multiverse/suites/net_http/Envfile
602
625
  - test/multiverse/suites/net_http/config/newrelic.yml
603
626
  - test/multiverse/suites/net_http/net_http_test.rb
@@ -684,10 +707,16 @@ files:
684
707
  - test/new_relic/agent/configuration/yaml_source_test.rb
685
708
  - test/new_relic/agent/cpu_sampler_test.rb
686
709
  - test/new_relic/agent/cross_app_monitor_test.rb
710
+ - test/new_relic/agent/cross_app_tracing_test.rb
687
711
  - test/new_relic/agent/database_test.rb
712
+ - test/new_relic/agent/datastores/mongo/metric_generator_test.rb
713
+ - test/new_relic/agent/datastores/mongo/metric_translator_test.rb
714
+ - test/new_relic/agent/datastores/mongo/obfuscator_test.rb
715
+ - test/new_relic/agent/datastores/mongo/statement_formatter_test.rb
688
716
  - test/new_relic/agent/error_collector/notice_error_test.rb
689
717
  - test/new_relic/agent/error_collector_test.rb
690
718
  - test/new_relic/agent/event_listener_test.rb
719
+ - test/new_relic/agent/harvester_test.rb
691
720
  - test/new_relic/agent/http_clients/uri_util_test.rb
692
721
  - test/new_relic/agent/instrumentation/action_controller_subscriber_test.rb
693
722
  - test/new_relic/agent/instrumentation/action_view_subscriber_test.rb
@@ -801,6 +830,7 @@ files:
801
830
  - test/performance/lib/performance/instrumentation/perf_tools.rb
802
831
  - test/performance/lib/performance/instrumentor.rb
803
832
  - test/performance/lib/performance/json_reporter.rb
833
+ - test/performance/lib/performance/platform.rb
804
834
  - test/performance/lib/performance/result.rb
805
835
  - test/performance/lib/performance/runner.rb
806
836
  - test/performance/lib/performance/test_case.rb
@@ -809,6 +839,7 @@ files:
809
839
  - test/performance/script/mega-runner
810
840
  - test/performance/script/runner
811
841
  - test/performance/suites/config.rb
842
+ - test/performance/suites/marshalling.rb
812
843
  - test/performance/suites/rum_autoinsertion.rb
813
844
  - test/performance/suites/startup.rb
814
845
  - test/performance/suites/thread_profiling.rb
@@ -940,23 +971,21 @@ files:
940
971
  - lib/new_relic/build.rb
941
972
  homepage: http://www.github.com/newrelic/rpm
942
973
  licenses: []
943
- post_install_message: ! "# New Relic Ruby Agent Release Notes #\n\n## v3.7.0 ##\n\n*
944
- Official Rubinius support (for Rubinius >= 2.2.1)\n\n We're happy to say that all
945
- known issues with the Ruby agent running on \n Rubinius have been resolved as of
946
- Rubinius version 2.2.1! See\n http://docs.newrelic.com/docs/ruby/rubinius for the
947
- most up-to-date status.\n\n* RUM injection updates\n\n The Ruby agent's code for
948
- both automatic and manual injection of Real User\n Monitoring scripts has been
949
- improved. No application changes are required, but\n the new injection logic is
950
- simpler, faster, more robust, and paves the way for\n future improvements to Real
951
- User Monitoring.\n\n* More robust communication with New Relic\n\n Failures when
952
- transmitting data to New Relic could cause data to be held over\n unnecessarily
953
- to a later harvest. This has been improved both to handle\n errors more robustly
954
- and consistently, and to send data as soon as possible.\n\n* Fix for agent not restarting
955
- on server-side config changes\n\n A bug in 3.6.9 caused the agent to not reset
956
- correctly after server-side\n config changes. New settings would not be received
957
- without a full process\n restart. This has been fixed.\n\n* Blacklisting rake spec
958
- tasks\n\n A blacklist helps the agent avoid starting during rake tasks. Some default\n
959
- \ RSpec tasks were missing. Thanks for the contribution Kohei Hasegawa!\n\nSee https://github.com/newrelic/rpm/blob/master/CHANGELOG
974
+ post_install_message: ! "# New Relic Ruby Agent Release Notes #\n\n## v3.7.1 ##\n\n*
975
+ MongoDB support\n\n The Ruby agent provides support for the mongo gem, versions
976
+ 1.8 and 1.9!\n Mongo calls are captured for transaction traces along with their
977
+ parameters,\n and time spent in Mongo shows up on the Database tab.\n\n Support
978
+ for more Mongo gems and more UI goodness will be coming, so watch\n http://docs.newrelic.com/docs/ruby/mongo
979
+ for up-to-date status.\n\n* Harvest thread restarts for forked and daemonized processes\n\n
980
+ \ Historically framework specific code was necessary for the Ruby agent to\n successfully
981
+ report data after an app forked or daemonized. Gems or scripts\n with daemonizing
982
+ modes had to wait for agent support or find workarounds.\n\n With 3.7.1 setting
983
+ `restart_thread_in_child: true` in your newrelic.yml\n automatically restarts the
984
+ agent in child processes without requiring custom\n code. For now the feature is
985
+ opt-in, but future releases may default it on.\n\n* Fix for missing HTTP time\n\n
986
+ \ The agent previously did not include connection establishment time for\n outgoing
987
+ Net::HTTP requests. This has been corrected, and reported HTTP\n timings should
988
+ now be more accurate.\n\nSee https://github.com/newrelic/rpm/blob/master/CHANGELOG
960
989
  for a full list of\nchanges.\n"
961
990
  rdoc_options:
962
991
  - --line-numbers
metadata.gz.sig CHANGED
@@ -1,2 +1 @@
1
- )��7���En�m
2
- {]b��_� � Z���
1
+ ��v���ۮF�΢BI/L��^�xdk�6�j�|�uY +Ch�����0jd\����*~8'P�Jpݛ3��4��>��[yG�q����&����y�Y��_7d�4���3����6�:�π`�wt�.���eϻ5y�=ަ�mǔ̀�z�B_8��g���|��w����@ugeu� �\�A�?�(���O����+Vh�A��4���\�m�M����I�g�p}�!�������_���������$����