newrelic_rpm 3.9.6.257 → 3.9.7.266

Sign up to get free protection for your applications and to get access to all the features.
Files changed (122) hide show
  1. data.tar.gz.sig +0 -0
  2. data/CHANGELOG +45 -0
  3. data/lib/new_relic/agent.rb +0 -1
  4. data/lib/new_relic/agent/agent.rb +61 -22
  5. data/lib/new_relic/agent/agent_logger.rb +11 -9
  6. data/lib/new_relic/agent/configuration/default_source.rb +25 -2
  7. data/lib/new_relic/agent/cross_app_monitor.rb +15 -53
  8. data/lib/new_relic/agent/cross_app_tracing.rb +11 -3
  9. data/lib/new_relic/agent/custom_event_aggregator.rb +98 -0
  10. data/lib/new_relic/agent/event_buffer.rb +84 -0
  11. data/lib/new_relic/agent/harvester.rb +4 -15
  12. data/lib/new_relic/agent/hostname.rb +1 -9
  13. data/lib/new_relic/agent/inbound_request_monitor.rb +41 -0
  14. data/lib/new_relic/agent/instrumentation/controller_instrumentation.rb +2 -2
  15. data/lib/new_relic/agent/instrumentation/queue_time.rb +0 -5
  16. data/lib/new_relic/agent/instrumentation/resque.rb +4 -9
  17. data/lib/new_relic/agent/javascript_instrumentor.rb +0 -12
  18. data/lib/new_relic/agent/method_tracer_helpers.rb +3 -1
  19. data/lib/new_relic/agent/new_relic_service.rb +1 -1
  20. data/lib/new_relic/agent/sampled_buffer.rb +13 -41
  21. data/lib/new_relic/agent/samplers/delayed_job_sampler.rb +52 -24
  22. data/lib/new_relic/agent/sized_buffer.rb +23 -0
  23. data/lib/new_relic/agent/synthetics_monitor.rb +50 -0
  24. data/lib/new_relic/agent/system_info.rb +28 -0
  25. data/lib/new_relic/agent/transaction.rb +78 -9
  26. data/lib/new_relic/agent/transaction/synthetics_sample_buffer.rb +25 -0
  27. data/lib/new_relic/agent/{request_sampler.rb → transaction_event_aggregator.rb} +53 -19
  28. data/lib/new_relic/agent/transaction_sample_builder.rb +3 -1
  29. data/lib/new_relic/agent/transaction_sampler.rb +10 -0
  30. data/lib/new_relic/agent/transaction_state.rb +1 -9
  31. data/lib/new_relic/coerce.rb +8 -2
  32. data/lib/new_relic/control.rb +0 -1
  33. data/lib/new_relic/local_environment.rb +12 -8
  34. data/lib/new_relic/metric_spec.rb +11 -2
  35. data/lib/new_relic/rack/developer_mode.rb +9 -1
  36. data/lib/new_relic/transaction_sample.rb +4 -10
  37. data/lib/new_relic/version.rb +1 -1
  38. data/newrelic_rpm.gemspec +1 -0
  39. data/test/agent_helper.rb +15 -2
  40. data/test/environments/norails/Gemfile +1 -0
  41. data/test/environments/rails21/Gemfile +1 -0
  42. data/test/environments/rails22/Gemfile +1 -0
  43. data/test/environments/rails23/Gemfile +1 -0
  44. data/test/environments/rails30/Gemfile +1 -0
  45. data/test/environments/rails31/Gemfile +1 -0
  46. data/test/environments/rails32/Gemfile +2 -1
  47. data/test/environments/rails40/Gemfile +2 -1
  48. data/test/environments/rails41/Gemfile +3 -1
  49. data/test/environments/rails42/Gemfile +3 -1
  50. data/test/fixtures/cross_agent_tests/README.md +6 -2
  51. data/test/fixtures/cross_agent_tests/docker_container_id/README.md +6 -0
  52. data/test/fixtures/cross_agent_tests/docker_container_id/cases.json +22 -0
  53. data/test/fixtures/cross_agent_tests/docker_container_id/docker-0.9.1.txt +10 -0
  54. data/test/fixtures/cross_agent_tests/docker_container_id/docker-1.0.0.txt +10 -0
  55. data/test/fixtures/cross_agent_tests/docker_container_id/docker-1.3.txt +9 -0
  56. data/test/fixtures/cross_agent_tests/docker_container_id/empty.txt +0 -0
  57. data/test/fixtures/cross_agent_tests/docker_container_id/lxc-containers-without-docker.txt +10 -0
  58. data/test/fixtures/cross_agent_tests/proc_meminfo/README.md +7 -0
  59. data/test/fixtures/cross_agent_tests/proc_meminfo/meminfo_4096MB.txt +47 -0
  60. data/test/fixtures/cross_agent_tests/rum_client_config.json +0 -80
  61. data/test/fixtures/cross_agent_tests/synthetics/synthetics.json +317 -0
  62. data/test/multiverse/lib/multiverse/runner.rb +1 -1
  63. data/test/multiverse/lib/multiverse/suite.rb +1 -0
  64. data/test/multiverse/suites/active_record/Envfile +42 -8
  65. data/test/multiverse/suites/active_record/ar_method_aliasing.rb +8 -4
  66. data/test/multiverse/suites/agent_only/audit_log_test.rb +0 -2
  67. data/test/multiverse/suites/agent_only/collector_exception_handling_test.rb +1 -2
  68. data/test/multiverse/suites/agent_only/cross_application_tracing_test.rb +5 -5
  69. data/test/multiverse/suites/agent_only/encoding_handling_test.rb +2 -0
  70. data/test/multiverse/suites/agent_only/harvest_timestamps_test.rb +8 -0
  71. data/test/multiverse/suites/agent_only/synthetics_test.rb +139 -0
  72. data/test/multiverse/suites/delayed_job/Envfile +79 -0
  73. data/test/multiverse/suites/delayed_job/before_suite.rb +33 -0
  74. data/test/multiverse/suites/delayed_job/config/newrelic.yml +18 -0
  75. data/test/multiverse/suites/delayed_job/delayed_job_sampler_test.rb +131 -0
  76. data/test/multiverse/suites/delayed_job/unsupported_backend_test.rb +24 -0
  77. data/test/multiverse/suites/high_security/high_security_test.rb +3 -10
  78. data/test/multiverse/suites/rails/Envfile +4 -4
  79. data/test/multiverse/suites/rails/request_statistics_test.rb +4 -4
  80. data/test/new_relic/agent/agent_test.rb +32 -4
  81. data/test/new_relic/agent/configuration/default_source_test.rb +6 -0
  82. data/test/new_relic/agent/cross_app_monitor_test.rb +23 -29
  83. data/test/new_relic/agent/custom_event_aggregator_test.rb +88 -0
  84. data/test/new_relic/agent/event_buffer_test_cases.rb +152 -0
  85. data/test/new_relic/agent/harvester_test.rb +5 -25
  86. data/test/new_relic/agent/hostname_test.rb +1 -1
  87. data/test/new_relic/agent/inbound_request_monitor_test.rb +49 -0
  88. data/test/new_relic/agent/instrumentation/controller_instrumentation_test.rb +9 -9
  89. data/test/new_relic/agent/instrumentation/queue_time_test.rb +0 -19
  90. data/test/new_relic/agent/javascript_instrumentor_test.rb +0 -45
  91. data/test/new_relic/agent/new_relic_service_test.rb +17 -12
  92. data/test/new_relic/agent/pipe_channel_manager_test.rb +4 -4
  93. data/test/new_relic/agent/sampled_buffer_test.rb +73 -145
  94. data/test/new_relic/agent/sized_buffer_test.rb +29 -0
  95. data/test/new_relic/agent/synthetics_monitor_test.rb +96 -0
  96. data/test/new_relic/agent/system_info_test.rb +19 -3
  97. data/test/new_relic/agent/transaction/developer_mode_sample_buffer_test.rb +14 -8
  98. data/test/new_relic/agent/transaction/synthetics_sample_buffer_test.rb +38 -0
  99. data/test/new_relic/agent/{request_sampler_test.rb → transaction_event_aggregator_test.rb} +55 -4
  100. data/test/new_relic/agent/transaction_sampler_test.rb +33 -11
  101. data/test/new_relic/agent/transaction_state_test.rb +0 -1
  102. data/test/new_relic/agent/transaction_test.rb +121 -19
  103. data/test/new_relic/coerce_test.rb +38 -3
  104. data/test/new_relic/control_test.rb +1 -0
  105. data/test/new_relic/fake_collector.rb +6 -2
  106. data/test/new_relic/fake_external_server.rb +2 -6
  107. data/test/new_relic/fake_server.rb +46 -29
  108. data/test/new_relic/http_client_test_cases.rb +71 -2
  109. data/test/new_relic/local_environment_test.rb +78 -0
  110. data/test/new_relic/metric_parser/metric_parser_test.rb +2 -0
  111. data/test/new_relic/metric_spec_test.rb +43 -0
  112. data/test/new_relic/multiverse_helpers.rb +11 -18
  113. data/test/new_relic/rack/browser_monitoring_test.rb +1 -18
  114. data/test/new_relic/rack/developer_mode_test.rb +1 -1
  115. data/test/new_relic/transaction_sample_test.rb +14 -4
  116. data/test/performance/suites/rack_middleware.rb +3 -1
  117. data/test/test_helper.rb +33 -0
  118. metadata +48 -7
  119. metadata.gz.sig +0 -0
  120. data/lib/new_relic/agent/browser_token.rb +0 -41
  121. data/test/multiverse/suites/agent_only/before_suite.rb +0 -7
  122. data/test/new_relic/agent/browser_token_test.rb +0 -56
@@ -110,7 +110,9 @@ module NewRelic
110
110
  @sample.params[:custom_params] ||= {}
111
111
  @sample.params[:custom_params].merge!(normalize_params(custom_params))
112
112
 
113
- @sample.force_persist = sample.force_persist_sample?
113
+ # If we ever implement saving of TTs based on the record_tt flag on the
114
+ # calling and called applications, we should change this flag's value.
115
+ @sample.force_persist = false
114
116
  @sample.threshold = transaction_trace_threshold
115
117
  @sample.finished = true
116
118
  @current_segment = nil
@@ -8,6 +8,7 @@ require 'new_relic/agent/transaction_sample_builder'
8
8
  require 'new_relic/agent/transaction/developer_mode_sample_buffer'
9
9
  require 'new_relic/agent/transaction/force_persist_sample_buffer'
10
10
  require 'new_relic/agent/transaction/slowest_sample_buffer'
11
+ require 'new_relic/agent/transaction/synthetics_sample_buffer'
11
12
  require 'new_relic/agent/transaction/xray_sample_buffer'
12
13
 
13
14
  module NewRelic
@@ -41,6 +42,7 @@ module NewRelic
41
42
  @sample_buffers << @dev_mode_sample_buffer
42
43
  @sample_buffers << @xray_sample_buffer
43
44
  @sample_buffers << NewRelic::Agent::Transaction::SlowestSampleBuffer.new
45
+ @sample_buffers << NewRelic::Agent::Transaction::SyntheticsSampleBuffer.new
44
46
  @sample_buffers << NewRelic::Agent::Transaction::ForcePersistSampleBuffer.new
45
47
 
46
48
  # This lock is used to synchronize access to the @last_sample
@@ -135,6 +137,14 @@ module NewRelic
135
137
  last_sample.set_custom_param(:'nr.path_hash', txn.cat_path_hash(state))
136
138
  end
137
139
 
140
+ if txn.is_synthetics_request?
141
+ last_sample.set_custom_param(:'nr.synthetics_resource_id', txn.synthetics_resource_id)
142
+ last_sample.set_custom_param(:'nr.synthetics_job_id', txn.synthetics_job_id)
143
+ last_sample.set_custom_param(:'nr.synthetics_monitor_id', txn.synthetics_monitor_id)
144
+
145
+ last_sample.synthetics_resource_id = txn.synthetics_resource_id
146
+ end
147
+
138
148
  @samples_lock.synchronize do
139
149
  @last_sample = last_sample
140
150
  store_sample(@last_sample)
@@ -2,7 +2,6 @@
2
2
  # This file is distributed under New Relic's license terms.
3
3
  # See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.
4
4
 
5
- require 'new_relic/agent/browser_token'
6
5
  require 'new_relic/agent/traced_method_stack'
7
6
 
8
7
  module NewRelic
@@ -40,11 +39,6 @@ module NewRelic
40
39
  @current_transaction = nil
41
40
  end
42
41
 
43
- def request=(request)
44
- @request = request
45
- @request_token = BrowserToken.get_token(request)
46
- end
47
-
48
42
  # This starts the timer for the transaction.
49
43
  def reset(transaction=nil)
50
44
  # We purposefully don't reset @untraced, @record_tt and @record_sql
@@ -57,7 +51,6 @@ module NewRelic
57
51
 
58
52
  @traced_method_stack.clear
59
53
 
60
- @request_token = nil
61
54
  @is_cross_app_caller = false
62
55
  @client_cross_app_id = nil
63
56
  @referring_transaction_info = nil
@@ -89,8 +82,7 @@ module NewRelic
89
82
  end
90
83
 
91
84
  # Request data
92
- attr_reader :request
93
- attr_accessor :request_token
85
+ attr_accessor :request
94
86
 
95
87
  def request_guid
96
88
  return nil unless current_transaction
@@ -56,12 +56,18 @@ module NewRelic
56
56
  end
57
57
  value.inject({}) do |memo, (key, val)|
58
58
  case val
59
- when String, Float, Integer
59
+ when String, Integer, TrueClass, FalseClass
60
60
  memo[key.to_s] = val
61
+ when Float
62
+ if val.finite?
63
+ memo[key.to_s] = val
64
+ else
65
+ memo[key.to_s] = nil
66
+ end
61
67
  when Symbol
62
68
  memo[key.to_s] = val.to_s
63
69
  end
64
- memo
70
+ memo
65
71
  end
66
72
  rescue => error
67
73
  log_failure(value.class, 'valid event params', context, error)
@@ -3,7 +3,6 @@
3
3
  # See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.
4
4
 
5
5
  require 'yaml'
6
- require 'conditional_vendored_metric_parser'
7
6
  require 'conditional_vendored_dependency_detection'
8
7
  require 'new_relic/local_environment'
9
8
  require 'new_relic/language_support'
@@ -146,14 +146,14 @@ module NewRelic
146
146
  end
147
147
 
148
148
  def check_for_resque
149
- using_resque = (
150
- defined?(::Resque) &&
151
- (ENV['QUEUE'] || ENV['QUEUES']) &&
152
- (File.basename($0) == 'rake' && ARGV.include?('resque:work'))
153
- ) || (
154
- defined?(::Resque::Pool) &&
155
- (File.basename($0) == 'resque-pool')
156
- )
149
+ has_queue = ENV['QUEUE'] || ENV['QUEUES']
150
+ resque_rake = executable == 'rake' && ARGV.include?('resque:work')
151
+ resque_pool_rake = executable == 'rake' && ARGV.include?('resque:pool')
152
+ resque_pool_executable = executable == 'resque-pool' && defined?(::Resque::Pool)
153
+
154
+ using_resque = defined?(::Resque) &&
155
+ (has_queue && resque_rake) ||
156
+ (resque_pool_executable || resque_pool_rake)
157
157
 
158
158
  @discovered_dispatcher = :resque if using_resque
159
159
  end
@@ -198,5 +198,9 @@ module NewRelic
198
198
  s << "]"
199
199
  end
200
200
 
201
+ def executable
202
+ File.basename($0)
203
+ end
204
+
201
205
  end
202
206
  end
@@ -13,9 +13,18 @@ class NewRelic::MetricSpec
13
13
  EMPTY_SCOPE = ''.freeze
14
14
 
15
15
  def initialize(metric_name='', metric_scope=nil)
16
- @name = metric_name.to_s[LENGTH_RANGE]
16
+ if metric_name.to_s.length > MAX_LENGTH
17
+ @name = metric_name.to_s[LENGTH_RANGE]
18
+ else
19
+ @name = metric_name.to_s
20
+ end
21
+
17
22
  if metric_scope
18
- @scope = metric_scope.to_s[LENGTH_RANGE]
23
+ if metric_scope.to_s.length > MAX_LENGTH
24
+ @scope = metric_scope.to_s[LENGTH_RANGE]
25
+ else
26
+ @scope = metric_scope.to_s
27
+ end
19
28
  else
20
29
  @scope = EMPTY_SCOPE
21
30
  end
@@ -6,12 +6,21 @@ require 'rack'
6
6
  require 'rack/request'
7
7
  require 'rack/response'
8
8
  require 'rack/file'
9
+
10
+ require 'conditional_vendored_metric_parser'
9
11
  require 'new_relic/collection_helper'
10
12
  require 'new_relic/metric_parser/metric_parser'
11
13
  require 'new_relic/rack/agent_middleware'
12
14
  require 'new_relic/agent/instrumentation/middleware_proxy'
13
15
 
16
+ require 'new_relic/transaction_sample'
17
+ require 'new_relic/transaction_analysis'
18
+
14
19
  module NewRelic
20
+ class TransactionSample
21
+ include TransactionAnalysis
22
+ end
23
+
15
24
  module Rack
16
25
  # This middleware provides the 'developer mode' feature of newrelic_rpm,
17
26
  # which allows you to see data about local web transactions in development
@@ -33,7 +42,6 @@ module NewRelic
33
42
  HELPER_PATH = File.expand_path('../../../../ui/helpers/', __FILE__)
34
43
  require File.join(HELPER_PATH, 'developer_mode_helper.rb')
35
44
 
36
-
37
45
  include NewRelic::DeveloperModeHelper
38
46
 
39
47
  class << self
@@ -16,14 +16,13 @@ module NewRelic
16
16
  class TransactionSample
17
17
 
18
18
  attr_accessor :params, :root_segment, :profile, :force_persist, :guid,
19
- :threshold, :finished, :xray_session_id, :start_time
19
+ :threshold, :finished, :xray_session_id, :start_time,
20
+ :synthetics_resource_id
20
21
  attr_reader :root_segment, :params, :sample_id
21
22
  attr_writer :prepared
22
23
 
23
24
  @@start_time = Time.now
24
25
 
25
- include TransactionAnalysis
26
-
27
26
  def initialize(time = Time.now.to_f, sample_id = nil)
28
27
  @sample_id = sample_id || object_id
29
28
  @start_time = time
@@ -76,7 +75,8 @@ module NewRelic
76
75
  string(@guid),
77
76
  nil,
78
77
  forced?,
79
- int_or_nil(xray_session_id)
78
+ int_or_nil(xray_session_id),
79
+ string(synthetics_resource_id)
80
80
  ]
81
81
  end
82
82
 
@@ -172,12 +172,6 @@ module NewRelic
172
172
  @params = params
173
173
  end
174
174
 
175
- def force_persist_sample? #THREAD_LOCAL_ACCESS
176
- state = NewRelic::Agent::TransactionState.tl_get
177
-
178
- state.request_token && self.duration > state.current_transaction.apdex_t
179
- end
180
-
181
175
  private
182
176
 
183
177
  def strip_sql!
@@ -12,7 +12,7 @@ module NewRelic
12
12
 
13
13
  MAJOR = 3
14
14
  MINOR = 9
15
- TINY = 6
15
+ TINY = 7
16
16
 
17
17
  begin
18
18
  require File.join(File.dirname(__FILE__), 'build')
@@ -51,6 +51,7 @@ EOS
51
51
  s.add_development_dependency 'guard', '~> 1.8.3' # Guard 2.0 is Ruby 1.9 only
52
52
  s.add_development_dependency 'guard-minitest'
53
53
  s.add_development_dependency 'rb-fsevent', '~> 0.9.1'
54
+ s.add_development_dependency 'hometown', '~> 0.2.5'
54
55
  s.add_development_dependency 'jruby-openssl' if RUBY_PLATFORM == 'java'
55
56
 
56
57
  if RUBY_PLATFORM == 'java'
@@ -414,7 +414,7 @@ def advance_time(seconds)
414
414
  freeze_time(Time.now + seconds)
415
415
  end
416
416
 
417
- def with_constant_defined(constant_symbol, implementation)
417
+ def with_constant_defined(constant_symbol, implementation=Module.new)
418
418
  const_path = constant_path(constant_symbol.to_s)
419
419
 
420
420
  if const_path
@@ -520,6 +520,19 @@ def with_environment(env)
520
520
  end
521
521
  end
522
522
 
523
+ def with_argv(argv)
524
+ old_argv = ARGV.dup
525
+ ARGV.clear
526
+ ARGV.concat(argv)
527
+
528
+ begin
529
+ yield
530
+ ensure
531
+ ARGV.clear
532
+ ARGV.concat(old_argv)
533
+ end
534
+ end
535
+
523
536
  def with_ignore_error_filter(filter, &blk)
524
537
  original_filter = NewRelic::Agent.ignore_error_filter
525
538
  NewRelic::Agent.ignore_error_filter(&filter)
@@ -534,7 +547,7 @@ def json_dump_and_encode(object)
534
547
  end
535
548
 
536
549
  def get_last_analytics_event
537
- NewRelic::Agent.agent.instance_variable_get(:@request_sampler).samples.last
550
+ NewRelic::Agent.agent.instance_variable_get(:@transaction_event_aggregator).samples.last
538
551
  end
539
552
 
540
553
  def swap_instance_method(target, method_name, new_method_implementation, &blk)
@@ -18,3 +18,4 @@ end
18
18
  gem "newrelic_rpm", :path => "../../.."
19
19
 
20
20
  gem 'pry', '~> 0.9.12'
21
+ gem 'hometown', '~> 0.2.5'
@@ -22,3 +22,4 @@ else
22
22
  end
23
23
 
24
24
  gem 'pry', '~> 0.9.12'
25
+ gem 'hometown', '~> 0.2.5'
@@ -22,3 +22,4 @@ else
22
22
  end
23
23
 
24
24
  gem 'pry', '~> 0.9.12'
25
+ gem 'hometown', '~> 0.2.5'
@@ -21,3 +21,4 @@ else
21
21
  end
22
22
 
23
23
  gem 'pry', '~> 0.9.12'
24
+ gem 'hometown', '~> 0.2.5'
@@ -20,3 +20,4 @@ else
20
20
  end
21
21
 
22
22
  gem 'pry', '~> 0.9.12'
23
+ gem 'hometown', '~> 0.2.5'
@@ -20,3 +20,4 @@ else
20
20
  end
21
21
 
22
22
  gem 'pry', '~> 0.9.12'
23
+ gem 'hometown', '~> 0.2.5'
@@ -1,6 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem 'rails', '~>3.2.15'
3
+ gem 'rails', '~>3.2.20'
4
4
 
5
5
  gem 'rake', '~>10.1.1'
6
6
  gem 'minitest', '~>4.7.5'
@@ -22,3 +22,4 @@ platforms :ruby, :rbx do
22
22
  end
23
23
 
24
24
  gem 'pry', '~> 0.9.12'
25
+ gem 'hometown', '~> 0.2.5'
@@ -2,7 +2,7 @@ source 'https://rubygems.org'
2
2
 
3
3
  gem 'rake'
4
4
 
5
- gem 'rails', '~>4.0.10'
5
+ gem 'rails', '~>4.0.11'
6
6
 
7
7
  # Do not automatically require minitest, since this will break with rbx-2.2.5.
8
8
  # rbx-2.2.5 helpfully bundles minitest-5.3.0.
@@ -40,3 +40,4 @@ end
40
40
  gem "newrelic_rpm", :path => "../../.."
41
41
 
42
42
  gem 'pry', '~> 0.9.12'
43
+ gem 'hometown', '~> 0.2.5'
@@ -2,7 +2,7 @@ source 'https://rubygems.org'
2
2
 
3
3
  gem 'rake'
4
4
 
5
- gem 'rails', '~>4.1.6'
5
+ gem 'rails', '~>4.1.7'
6
6
 
7
7
  gem 'minitest', '5.2.3'
8
8
  gem 'mocha', :require => false
@@ -30,4 +30,6 @@ platforms :rbx do
30
30
  end
31
31
 
32
32
  gem "newrelic_rpm", :path => "../../.."
33
+
33
34
  gem 'pry', '~> 0.9.12'
35
+ gem 'hometown', '~> 0.2.5'
@@ -2,7 +2,7 @@ source 'https://rubygems.org'
2
2
 
3
3
  gem 'rake'
4
4
 
5
- gem 'rails', '~>4.2.0.beta2'
5
+ gem 'rails', '~>4.2.0.beta4'
6
6
 
7
7
  gem 'minitest', '5.2.3'
8
8
  gem 'mocha', :require => false
@@ -30,4 +30,6 @@ platforms :rbx do
30
30
  end
31
31
 
32
32
  gem "newrelic_rpm", :path => "../../.."
33
+
33
34
  gem 'pry', '~> 0.9.12'
35
+ gem 'hometown', '~> 0.2.5'
@@ -13,7 +13,6 @@ Please be careful when adding new tests from real world failures.
13
13
  | [rum_footer_insertion_location](rum_footer_insertion_location) | Describe where the RUM footer (aka "client config") should be inserted. These tests do not apply to agents which insert the footer directly after the loader. |
14
14
  | [rules.json](rules.json) | Describe how url/metric/txn-name rules should be applied. |
15
15
  | [rum_client_config.json](rum_client_config.json) | These tests dictate the format and contents of the browser monitoring client configuration. For more information see: [SPEC](https://newrelic.atlassian.net/wiki/display/eng/JavaScript+Agent+Auto-Instrumentation) |
16
- | [rum_cookie.json](rum_cookie.json) | These tests indicate the format requirements of a valid RUM cookie. |
17
16
  | [sql_parsing.json](sql_parsing.json) | These tests show how an SQL string should be parsed for the operation and table name. |
18
17
  | [url_clean.json](url_clean.json) | These tests show how URLs should be cleaned before putting them into a trace segment's parameter hash (under the key 'uri'). |
19
18
  | [url_domain_extraction.json](url_domain_extraction.json) | These tests show how the domain of a URL should be extracted (for the purpose of creating external metrics). |
@@ -21,8 +20,11 @@ Please be careful when adding new tests from real world failures.
21
20
  | [sql_obfuscation](sql_obfuscation) | Describe how agents should obfuscate SQL queries before transmission to the collector. |
22
21
  | [attribute_configuration](attribute_configuration.json) | These tests show how agents should respond to the various attribute configuration settings. For more information see: [Attributes SPEC](https://newrelic.atlassian.net/wiki/display/eng/Agent+Attributes) |
23
22
  | [cat_map](cat_map.json) | These tests cover the new Dirac attributes that are added for the CAT Map project. See the [CAT Map Spec](https://newrelic.jiveon.com/docs/DOC-1798) and the section below for details.|
24
- | [labels](labels.json) | These tests cover the Labels for Language Agents project. See the [Labels for Language Agents Spec](https://newrelic.atlassian.net/wiki/display/eng/Labels+for+Language+Agents+-+draft+spec) for details.|
23
+ | [labels](labels.json) | These tests cover the Labels for Language Agents project. See the [Labels for Language Agents Spec](https://newrelic.atlassian.net/wiki/display/eng/Labels+for+Language+Agents) for details.|
25
24
  | [proc_cpuinfo](proc_cpuinfo) | These test correct processing of `/proc/cpuinfo` output on Linux hosts. |
25
+ | [proc_meminfo](proc_meminfo) | These test correct processing of `/proc/meminfo` output on Linux hosts. |
26
+ | [transaction_segment_terms.json](transaction_segment_terms.json) | These tests cover agent implementations of the `transaction_segment_terms` transaction renaming rules introduced in collector protocol 14. See [the spec](https://newrelic.atlassian.net/wiki/display/eng/Language+agent+transaction+segment+terms+rules) for details. |
27
+ | [docker_container_id](docker_container_id) | These tests cover parsing of Docker container IDs from `/proc` on Linux hosts. |
26
28
 
27
29
  ### CAT Map test details
28
30
 
@@ -30,6 +32,8 @@ The CAT map test cases in `cat_map.json` are meant to be used to verify the
30
32
  attributes that agents collect and attach to analytics transaction events for
31
33
  the CAT map project.
32
34
 
35
+ **NOTE** currently `nr.apdexPerfZone` is not covered by these tests, make sure you test for this yourself until it is added to these tests.
36
+
33
37
  Each test case should correspond to a simulated transaction in the agent under
34
38
  test. Here's what the various fields in each test case mean:
35
39
 
@@ -0,0 +1,6 @@
1
+ These tests cover parsing of Docker container IDs on Linux hosts out of
2
+ `/proc/self/cgroup` (or `/proc/<pid>/cgroup` more generally).
3
+
4
+ The `cases.json` file lists each filename in this directory containing
5
+ example `/proc/self/cgroup` content, and the expected Docker container ID that
6
+ should be parsed from that file.
@@ -0,0 +1,22 @@
1
+ [
2
+ {
3
+ "filename": "docker-0.9.1.txt",
4
+ "dockerContainerId": "f37a7e4d17017e7bf774656b19ca4360c6cdc4951c86700a464101d0d9ce97ee"
5
+ },
6
+ {
7
+ "filename": "docker-1.0.0.txt",
8
+ "dockerContainerId": "3ccfa00432798ff38f85839de1e396f771b4acbe9f4ddea0a761c39b9790a782"
9
+ },
10
+ {
11
+ "filename": "docker-1.3.txt",
12
+ "dockerContainerId": "47cbd16b77c50cbf71401c069cd2189f0e659af17d5a2daca3bddf59d8a870b2"
13
+ },
14
+ {
15
+ "filename": "lxc-containers-without-docker.txt",
16
+ "dockerContainerId": null
17
+ },
18
+ {
19
+ "filename": "empty.txt",
20
+ "dockerContainerId": null
21
+ }
22
+ ]