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.
Files changed (137) hide show
  1. data.tar.gz.sig +0 -0
  2. data/.gitignore +1 -0
  3. data/.yardopts +17 -0
  4. data/CHANGELOG +48 -0
  5. data/README.md +8 -6
  6. data/lib/new_relic/agent.rb +65 -17
  7. data/lib/new_relic/agent/agent.rb +42 -113
  8. data/lib/new_relic/agent/browser_monitoring.rb +9 -1
  9. data/lib/new_relic/agent/configuration/default_source.rb +12 -0
  10. data/lib/new_relic/agent/error_collector.rb +13 -6
  11. data/lib/new_relic/agent/instrumentation/active_record_subscriber.rb +5 -5
  12. data/lib/new_relic/agent/instrumentation/controller_instrumentation.rb +15 -0
  13. data/lib/new_relic/agent/instrumentation/curb.rb +2 -2
  14. data/lib/new_relic/agent/instrumentation/metric_frame.rb +2 -2
  15. data/lib/new_relic/agent/instrumentation/rack.rb +2 -0
  16. data/lib/new_relic/agent/instrumentation/resque.rb +9 -3
  17. data/lib/new_relic/agent/instrumentation/sidekiq.rb +5 -0
  18. data/lib/new_relic/agent/method_tracer.rb +45 -27
  19. data/lib/new_relic/agent/new_relic_service.rb +14 -6
  20. data/lib/new_relic/agent/pipe_service.rb +1 -1
  21. data/lib/new_relic/agent/request_sampler.rb +10 -7
  22. data/lib/new_relic/agent/rules_engine.rb +5 -0
  23. data/lib/new_relic/agent/samplers/object_sampler.rb +1 -1
  24. data/lib/new_relic/agent/sql_sampler.rb +4 -2
  25. data/lib/new_relic/agent/stats_engine.rb +3 -0
  26. data/lib/new_relic/agent/stats_engine/gc_profiler.rb +17 -7
  27. data/lib/new_relic/agent/stats_engine/metric_stats.rb +5 -7
  28. data/lib/new_relic/agent/stats_engine/stats_hash.rb +2 -0
  29. data/lib/new_relic/agent/supported_versions.rb +247 -0
  30. data/lib/new_relic/agent/threading/backtrace_service.rb +1 -1
  31. data/lib/new_relic/agent/threading/thread_profile.rb +2 -1
  32. data/lib/new_relic/agent/transaction.rb +7 -6
  33. data/lib/new_relic/agent/transaction/developer_mode_sample_buffer.rb +11 -5
  34. data/lib/new_relic/agent/transaction/force_persist_sample_buffer.rb +3 -3
  35. data/lib/new_relic/agent/transaction/slowest_sample_buffer.rb +3 -3
  36. data/lib/new_relic/agent/transaction/transaction_sample_buffer.rb +23 -4
  37. data/lib/new_relic/agent/transaction/xray_sample_buffer.rb +4 -4
  38. data/lib/new_relic/agent/transaction_sampler.rb +14 -18
  39. data/lib/new_relic/agent/worker_loop.rb +1 -0
  40. data/lib/new_relic/control.rb +1 -0
  41. data/lib/new_relic/control/instance_methods.rb +0 -1
  42. data/lib/new_relic/helper.rb +1 -2
  43. data/lib/new_relic/language_support.rb +12 -2
  44. data/lib/new_relic/local_environment.rb +12 -11
  45. data/lib/new_relic/rack.rb +9 -0
  46. data/lib/new_relic/rack/agent_hooks.rb +6 -0
  47. data/lib/new_relic/rack/browser_monitoring.rb +9 -2
  48. data/lib/new_relic/rack/developer_mode.rb +15 -1
  49. data/lib/new_relic/rack/error_collector.rb +7 -0
  50. data/lib/new_relic/recipes.rb +2 -0
  51. data/lib/new_relic/transaction_sample.rb +39 -48
  52. data/lib/new_relic/version.rb +1 -1
  53. data/lib/tasks/install.rake +44 -2
  54. data/lib/tasks/versions.html.erb +31 -0
  55. data/lib/tasks/versions.rake +52 -0
  56. data/lib/tasks/versions.txt.erb +14 -0
  57. data/newrelic_rpm.gemspec +4 -2
  58. data/test/agent_helper.rb +21 -1
  59. data/test/environments/lib/environments/runner.rb +19 -5
  60. data/test/environments/norails/Gemfile +4 -1
  61. data/test/environments/rails21/Gemfile +4 -6
  62. data/test/environments/rails21/Rakefile +4 -0
  63. data/test/environments/rails21/config/database.yml +2 -7
  64. data/test/environments/rails22/Gemfile +6 -13
  65. data/test/environments/rails22/Rakefile +4 -0
  66. data/test/environments/rails22/config/database.yml +2 -7
  67. data/test/environments/rails22/config/environment.rb +1 -1
  68. data/test/environments/rails23/Gemfile +3 -4
  69. data/test/environments/rails23/Rakefile +4 -0
  70. data/test/environments/rails23/config/database.yml +2 -7
  71. data/test/environments/rails30/Gemfile +2 -4
  72. data/test/environments/rails30/Rakefile +2 -0
  73. data/test/environments/rails30/config/database.yml +2 -7
  74. data/test/environments/rails31/Gemfile +2 -4
  75. data/test/environments/rails31/Rakefile +2 -0
  76. data/test/environments/rails31/config/database.yml +2 -7
  77. data/test/environments/rails32/Gemfile +2 -5
  78. data/test/environments/rails32/Rakefile +2 -0
  79. data/test/environments/rails32/config/database.yml +1 -1
  80. data/test/environments/rails40/Gemfile +7 -4
  81. data/test/environments/rails40/Rakefile +2 -0
  82. data/test/environments/rails40/config/database.yml +2 -7
  83. data/test/helpers/runtime_detection.rb +17 -0
  84. data/test/multiverse/lib/multiverse/suite.rb +20 -4
  85. data/test/multiverse/suites/agent_only/key_transactions_test.rb +1 -1
  86. data/test/multiverse/suites/agent_only/marshaling_test.rb +1 -1
  87. data/test/multiverse/suites/agent_only/thread_profiling_test.rb +32 -7
  88. data/test/multiverse/suites/agent_only/xray_sessions_test.rb +1 -0
  89. data/test/multiverse/suites/config_file_loading/config_file_loading_test.rb +4 -3
  90. data/test/multiverse/suites/curb/curb_test.rb +8 -0
  91. data/test/multiverse/suites/excon/excon_test.rb +8 -0
  92. data/test/multiverse/suites/httpclient/httpclient_test.rb +8 -0
  93. data/test/multiverse/suites/net_http/net_http_test.rb +8 -0
  94. data/test/multiverse/suites/padrino/Envfile +3 -2
  95. data/test/multiverse/suites/rails/gc_instrumentation_test.rb +17 -8
  96. data/test/multiverse/suites/resque/Envfile +3 -3
  97. data/test/multiverse/suites/resque/instrumentation_test.rb +47 -5
  98. data/test/multiverse/suites/sequel/Envfile +0 -3
  99. data/test/multiverse/suites/sequel/database.rb +53 -0
  100. data/test/{new_relic/agent/instrumentation/sequel_test.rb → multiverse/suites/sequel/sequel_instrumentation_test.rb} +12 -53
  101. data/test/multiverse/suites/sequel/{sequel_test.rb → sequel_safety_test.rb} +2 -17
  102. data/test/multiverse/suites/sidekiq/sidekiq_instrumentation_test.rb +50 -5
  103. data/test/multiverse/suites/sinatra/sinatra_metric_explosion_test.rb +15 -2
  104. data/test/multiverse/suites/typhoeus/typhoeus_test.rb +8 -0
  105. data/test/new_relic/agent/agent/connect_test.rb +3 -2
  106. data/test/new_relic/agent/agent_test.rb +89 -82
  107. data/test/new_relic/agent/browser_monitoring_test.rb +44 -1
  108. data/test/new_relic/agent/error_collector_test.rb +17 -20
  109. data/test/new_relic/agent/instrumentation/active_record_instrumentation_test.rb +13 -10
  110. data/test/new_relic/agent/instrumentation/active_record_subscriber_test.rb +16 -1
  111. data/test/new_relic/agent/instrumentation/task_instrumentation_test.rb +2 -2
  112. data/test/new_relic/agent/method_tracer/instance_methods/trace_execution_scoped_test.rb +1 -1
  113. data/test/new_relic/agent/new_relic_service_test.rb +78 -9
  114. data/test/new_relic/agent/pipe_channel_manager_test.rb +7 -9
  115. data/test/new_relic/agent/pipe_service_test.rb +4 -4
  116. data/test/new_relic/agent/request_sampler_test.rb +2 -2
  117. data/test/new_relic/agent/stats_engine/gc_profiler_test.rb +15 -35
  118. data/test/new_relic/agent/stats_engine/metric_stats_test.rb +15 -7
  119. data/test/new_relic/agent/stats_engine_test.rb +4 -3
  120. data/test/new_relic/agent/threading/backtrace_service_test.rb +2 -0
  121. data/test/new_relic/agent/threading/thread_profile_test.rb +19 -0
  122. data/test/new_relic/agent/transaction/developer_mode_sample_buffer_test.rb +4 -4
  123. data/test/new_relic/agent/transaction/force_persist_sample_buffer_test.rb +1 -1
  124. data/test/new_relic/agent/transaction_sampler_test.rb +60 -45
  125. data/test/new_relic/fake_collector.rb +37 -2
  126. data/test/new_relic/http_client_test_cases.rb +26 -1
  127. data/test/new_relic/language_support_test.rb +12 -31
  128. data/test/new_relic/local_environment_test.rb +6 -2
  129. data/test/new_relic/multiverse_helpers.rb +2 -5
  130. data/test/new_relic/transaction_sample_test.rb +57 -36
  131. data/test/performance/suites/config.rb +76 -0
  132. data/test/rum/no_html_and_no_header.result.html +3 -0
  133. data/test/rum/no_html_and_no_header.source.html +3 -0
  134. data/test/script/ci.sh +0 -2
  135. data/test/test_helper.rb +5 -0
  136. metadata +43 -26
  137. metadata.gz.sig +0 -0
@@ -12,6 +12,11 @@ module NewRelic
12
12
 
13
13
  attr_accessor :rules
14
14
 
15
+ def self.from_specs(specs)
16
+ rules = (specs || []).map { |spec| Rule.new(spec) }
17
+ self.new(rules)
18
+ end
19
+
15
20
  def initialize(rules=[])
16
21
  @rules = rules
17
22
  end
@@ -13,7 +13,7 @@ module NewRelic
13
13
  end
14
14
 
15
15
  def self.supported_on_this_platform?
16
- NewRelic::LanguageSupport.object_space_enabled? && ObjectSpace.respond_to?(:live_objects)
16
+ NewRelic::LanguageSupport.object_space_usable? && ObjectSpace.respond_to?(:live_objects)
17
17
  end
18
18
 
19
19
  def poll
@@ -111,7 +111,7 @@ module NewRelic
111
111
  end
112
112
  end
113
113
 
114
- def merge(sql_traces)
114
+ def merge!(sql_traces)
115
115
  @samples_lock.synchronize do
116
116
  #FIXME we need to merge the sql_traces array back into the @sql_traces hash
117
117
  # @sql_traces.merge! sql_traces
@@ -130,8 +130,10 @@ module NewRelic
130
130
  slowest
131
131
  end
132
132
 
133
- # reset samples without rebooting the web server
134
133
  def reset!
134
+ @samples_lock.synchronize do
135
+ @sql_traces = {}
136
+ end
135
137
  end
136
138
  end
137
139
 
@@ -16,11 +16,14 @@ module NewRelic
16
16
  include Samplers
17
17
  include Transactions
18
18
 
19
+ attr_accessor :metric_rules
20
+
19
21
  def initialize
20
22
  # Makes the unit tests happy
21
23
  NewRelic::Agent::TransactionState.get.clear_stats_scope_stack
22
24
  @stats_lock = Mutex.new
23
25
  @stats_hash = StatsHash.new
26
+ @metric_rules = RulesEngine.new
24
27
  end
25
28
 
26
29
  # All access to the @stats_hash ivar should be funnelled through this
@@ -8,9 +8,9 @@ module NewRelic
8
8
  class StatsEngine
9
9
  module GCProfiler
10
10
  def self.init
11
- @profiler = RailsBench.new if RailsBench.enabled?
12
- @profiler = Ruby19.new if Ruby19.enabled?
13
- @profiler = Rubinius.new if Rubinius.enabled?
11
+ @profiler = RailsBenchProfiler.new if RailsBenchProfiler.enabled?
12
+ @profiler = CoreGCProfiler.new if CoreGCProfiler.enabled?
13
+ @profiler = LegacyRubiniusProfiler.new if LegacyRubiniusProfiler.enabled?
14
14
  @profiler
15
15
  end
16
16
 
@@ -61,7 +61,7 @@ module NewRelic
61
61
  end
62
62
  end
63
63
 
64
- class RailsBench < Profiler
64
+ class RailsBenchProfiler < Profiler
65
65
  def self.enabled?
66
66
  ::GC.respond_to?(:time) && ::GC.respond_to?(:collections)
67
67
  end
@@ -80,9 +80,10 @@ module NewRelic
80
80
  end
81
81
  end
82
82
 
83
- class Ruby19 < Profiler
83
+ class CoreGCProfiler < Profiler
84
84
  def self.enabled?
85
- defined?(::GC::Profiler) && ::GC::Profiler.enabled?
85
+ !NewRelic::LanguageSupport.using_engine?('jruby') &&
86
+ defined?(::GC::Profiler) && ::GC::Profiler.enabled?
86
87
  end
87
88
 
88
89
  # microseconds spent in GC
@@ -101,11 +102,20 @@ module NewRelic
101
102
  end
102
103
  end
103
104
 
104
- class Rubinius < Profiler
105
+ # Only present for legacy support of Rubinius < 2.0.0
106
+ class LegacyRubiniusProfiler < Profiler
105
107
  def self.enabled?
108
+ self.has_rubinius_profiler? && !has_core_profiler?
109
+ end
110
+
111
+ def self.has_rubinius_profiler?
106
112
  defined?(::Rubinius) && defined?(::Rubinius::GC) && ::Rubinius::GC.respond_to?(:count)
107
113
  end
108
114
 
115
+ def self.has_core_profiler?
116
+ defined?(::GC::Profiler)
117
+ end
118
+
109
119
  def call_time
110
120
  ::Rubinius::GC.time * 1000
111
121
  end
@@ -131,14 +131,12 @@ module NewRelic
131
131
  end
132
132
  end
133
133
 
134
- # Harvest the timeslice data. First recombine current statss
135
- # with any previously
136
- # unsent metrics, clear out stats cache, and return the current
137
- # stats.
138
- def harvest_timeslice_data(old_stats_hash, rules_engine=RulesEngine.new)
134
+ def harvest
135
+ now = Time.now
139
136
  snapshot = reset_stats
140
- snapshot = apply_rules_to_metric_data(rules_engine, snapshot)
141
- snapshot.merge!(old_stats_hash)
137
+ snapshot = apply_rules_to_metric_data(@metric_rules, snapshot)
138
+ snapshot.harvested_at = now
139
+ snapshot
142
140
  end
143
141
 
144
142
  def apply_rules_to_metric_data(rules_engine, stats_hash)
@@ -18,6 +18,8 @@ require 'new_relic/agent/internal_agent_error'
18
18
  module NewRelic
19
19
  module Agent
20
20
  class StatsHash < ::Hash
21
+ attr_accessor :harvested_at
22
+
21
23
  def initialize
22
24
  super { |hash, key| hash[key] = NewRelic::Agent::Stats.new }
23
25
  end
@@ -0,0 +1,247 @@
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 Agent
7
+ SUPPORTED_VERSIONS =
8
+ {
9
+ # Rubies
10
+ :mri =>
11
+ {
12
+ :type => :ruby,
13
+ :name => "MRI",
14
+ :supported => ["1.8.7", "1.9.2", "1.9.3", "2.0.0"],
15
+ :deprecated => ["1.8.6"],
16
+ :experimental=> [">= 2.1.0"],
17
+ :url => "https://www.ruby-lang.org",
18
+ :feed => "https://www.ruby-lang.org/en/feeds/news.rss",
19
+ :notes => [
20
+ "1.8.7 includes support for Ruby Enterprise Edition (REE)",
21
+ "Last supported agent on 1.8.6 was 3.6.8.168"]
22
+ },
23
+ :jruby =>
24
+ {
25
+ :type => :ruby,
26
+ :name => "JRuby",
27
+ :supported => ["~> 1.6.0", "~> 1.7.0"],
28
+ :url => "http://jruby.org",
29
+ :feed => "http://jruby.org/atom.xml"
30
+ },
31
+ :rbx =>
32
+ {
33
+ :type => :ruby,
34
+ :name => "Rubinius",
35
+ :experimental=> ["~> 2.1.1"],
36
+ :url => "http://rubini.us",
37
+ :feed => "http://rubini.us/feed/atom.xml",
38
+ :notes => [
39
+ "Support for Rubinius 2.x is considered experimental.",
40
+ "Consider using the latest for best results, and watch http://docs.newrelic.com/docs/ruby/rubinius for updates."]
41
+ },
42
+
43
+ # App servers
44
+ :passenger =>
45
+ {
46
+ :type => :app_server,
47
+ :supported => ["~>2.2", "~>3.0", "~>4.0"],
48
+ :url => "http://www.phusionpassenger.com/",
49
+ :feed => "http://rubygems.org/gems/passenger/versions.atom"
50
+ },
51
+ :thin =>
52
+ {
53
+ :type => :app_server,
54
+ :supported => ["~>1.0"],
55
+ :url => "http://code.macournoyer.com/thin/",
56
+ :feed => "http://rubygems.org/gems/thin/versions.atom"
57
+ },
58
+ :unicorn =>
59
+ {
60
+ :type => :app_server,
61
+ :supported => ["~>4.0"],
62
+ :deprecated => ["~>1.0", "~>2.0", "~>3.0"],
63
+ :url => "http://unicorn.bogomips.org/",
64
+ :feed => "http://rubygems.org/gems/unicorn/versions.atom"
65
+ },
66
+ :puma =>
67
+ {
68
+ :type => :app_server,
69
+ :supported => ["~>2.0"],
70
+ :deprecated => ["~>1.0"],
71
+ :url => "http://puma.io/",
72
+ :feed => "http://rubygems.org/gems/puma/versions.atom"
73
+ },
74
+ :rainbows =>
75
+ {
76
+ :type => :app_server,
77
+ :name => "rainbows!",
78
+ :experimental=> ["4.5.0"],
79
+ :url => "http://rainbows.rubyforge.org/",
80
+ :feed => "http://rubygems.org/gems/rainbows/versions.atom"
81
+ },
82
+ :webrick =>
83
+ {
84
+ :type => :app_server,
85
+ :notes => [ "Supported for all agent-supported versions of Ruby" ]
86
+ },
87
+
88
+ # Web frameworks
89
+ :rails =>
90
+ {
91
+ :type => :web,
92
+ :supported => ["~>2.1.0", "~>2.2.0", "~>2.3.0", "~3.0.0", "~>3.1.0", "~>3.2.0", "~>4.0.0"],
93
+ :deprecated => ["~>2.0.0"],
94
+ :url => "https://rubygems.org/gems/rails",
95
+ :feed => "https://rubygems.org/gems/rails/versions.atom",
96
+ :notes => ["Last supported agent for 2.0.x was 3.6.8.168"]
97
+ },
98
+ :sinatra =>
99
+ {
100
+ :type => :web,
101
+ :supported => ["~>1.2.0", "~>1.3.0", "~>1.4.0"],
102
+ :url => "https://rubygems.org/gems/sinatra",
103
+ :feed => "https://rubygems.org/gems/sinatra/versions.atom"
104
+ },
105
+ :padrino =>
106
+ {
107
+ :type => :web,
108
+ :supported => ["~>0.10"],
109
+ :url => "https://rubygems.org/gems/padrino",
110
+ :feed => "https://rubygems.org/gems/padrino/versions.atom"
111
+ },
112
+ :rack =>
113
+ {
114
+ :type => :web,
115
+ :supported => [">= 1.0.0"],
116
+ :url => "https://rubygems.org/gems/rack",
117
+ :feed => "https://rubygems.org/gems/rack/versions.atom"
118
+ },
119
+
120
+ # Database
121
+ :activerecord =>
122
+ {
123
+ :type => :database,
124
+ :supported => ["~>2.1.0", "~>2.2.0", "~>2.3.0", "~3.0.0", "~>3.1.0", "~>3.2.0", "~>4.0.0"],
125
+ :deprecated => ["~>2.0.0"],
126
+ :url => "https://rubygems.org/gems/activerecord",
127
+ :feed => "https://rubygems.org/gems/activerecord/versions.atom",
128
+ :notes => ["Last supported agent for 2.0.x was 3.6.8.168"]
129
+ },
130
+ :datamapper =>
131
+ {
132
+ :type => :database,
133
+ :supported => ["~>1.0"],
134
+ :url => "https://rubygems.org/gems/datamapper",
135
+ :feed => "https://rubygems.org/gems/datamapper/versions.atom"
136
+ },
137
+ :sequel =>
138
+ {
139
+ :type => :database,
140
+ :supported => ["~>3.37", "~>4.0"],
141
+ :url => "https://rubygems.org/gems/sequel",
142
+ :feed => "https://rubygems.org/gems/sequel/versions.atom"
143
+ },
144
+
145
+ # Background Jobs
146
+ :resque =>
147
+ {
148
+ :type => :background,
149
+ :supported => ["~>1.23.0"],
150
+ :deprecated => ["~>1.22.0"],
151
+ :experimental=> [">= 2.0"],
152
+ :url => "https://rubygems.org/gems/resque",
153
+ :feed => "https://rubygems.org/gems/resque/versions.atom"
154
+ },
155
+ :sidekiq =>
156
+ {
157
+ :type => :background,
158
+ :supported => ["~>2.8"],
159
+ :url => "https://rubygems.org/gems/sidekiq",
160
+ :feed => "https://rubygems.org/gems/sidekiq/versions.atom"
161
+ },
162
+ :delayed_job =>
163
+ {
164
+ :type => :background,
165
+ :supported => ["~>2.0", "~>3.0", "~>4.0"],
166
+ :url => "https://rubygems.org/gems/delayed_job",
167
+ :feed => "https://rubygems.org/gems/delayed_job/versions.atom"
168
+ },
169
+
170
+ # HTTP Clients
171
+ :curb =>
172
+ {
173
+ :type => :http,
174
+ :supported => [ ">= 0.8.1" ],
175
+ :url => "https://rubygems.org/gems/curb",
176
+ :feed => "https://rubygems.org/gems/curb/versions.atom"
177
+ },
178
+ :excon =>
179
+ {
180
+ :type => :http,
181
+ :supported => [ ">= 0.10.1" ],
182
+ :url => "https://rubygems.org/gems/excon",
183
+ :feed => "https://rubygems.org/gems/excon/versions.atom"
184
+ },
185
+ :httpclient =>
186
+ {
187
+ :type => :http,
188
+ :supported => [ ">= 2.2.0"],
189
+ :url => "https://rubygems.org/gems/httpclient",
190
+ :feed => "https://rubygems.org/gems/httpclient/versions.atom"
191
+ },
192
+ :typhoeus =>
193
+ {
194
+ :type => :http,
195
+ :supported => [ ">= 0.5.3"],
196
+ :url => "https://rubygems.org/gems/typhoeus",
197
+ :feed => "https://rubygems.org/gems/typhoeus/versions.atom"
198
+ },
199
+ :net_http =>
200
+ {
201
+ :type => :http,
202
+ :name => "Net::HTTP",
203
+ :notes => [
204
+ "Supported for all agent-supported versions of Ruby.",
205
+ "For more information on supported HTTP clients see http://docs.newrelic.com/docs/ruby/ruby-http-clients."]
206
+ },
207
+
208
+ # Other
209
+ :sunspot =>
210
+ {
211
+ :type => :other,
212
+ :url => "https://rubygems.org/gems/sunspot",
213
+ :feed => "https://rubygems.org/gems/sunspot/versions.atom"
214
+ },
215
+ :acts_as_solr =>
216
+ {
217
+ :type => :other,
218
+ :url => "https://rubygems.org/gems/acts_as_solr",
219
+ :feed => "https://rubygems.org/gems/acts_as_solr/versions.atom"
220
+ },
221
+ :dalli =>
222
+ {
223
+ :type => :other,
224
+ :url => "https://rubygems.org/gems/dalli",
225
+ :feed => "https://rubygems.org/gems/dalli/versions.atom"
226
+ },
227
+ :'memcache-client' =>
228
+ {
229
+ :type => :other,
230
+ :url => "https://rubygems.org/gems/memcache-client",
231
+ :feed => "https://rubygems.org/gems/memcache-client/versions.atom"
232
+ },
233
+ :authlogic =>
234
+ {
235
+ :type => :other,
236
+ :url => "https://rubygems.org/gems/authlogic",
237
+ :feed => "https://rubygems.org/gems/authlogic/versions.atom"
238
+ },
239
+ :activemerchant =>
240
+ {
241
+ :type => :other,
242
+ :url => "https://rubygems.org/gems/activemerchant",
243
+ :feed => "https://rubygems.org/gems/activemerchant/versions.atom"
244
+ },
245
+ }
246
+ end
247
+ end
@@ -159,7 +159,7 @@ module NewRelic
159
159
  AgentThread.list.each do |thread|
160
160
  sample_thread(thread)
161
161
  end
162
- @profiles.values.each { |c| c.increment_poll_count }
162
+ @profiles.each_value { |p| p.increment_poll_count }
163
163
  @buffer.delete_if { |thread, _| !thread.alive? }
164
164
  end
165
165
 
@@ -104,12 +104,13 @@ module NewRelic
104
104
  end
105
105
 
106
106
  def to_collector_array(encoder)
107
+ encoded_trace_tree = encoder.encode(generate_traces)
107
108
  result = [
108
109
  int(self.profile_id),
109
110
  float(self.created_at),
110
111
  float(self.finished_at),
111
112
  int(self.sample_count),
112
- string(encoder.encode(generate_traces)),
113
+ encoded_trace_tree,
113
114
  int(self.unique_thread_count),
114
115
  0 # runnable thread count, which we don't track
115
116
  ]
@@ -5,14 +5,12 @@
5
5
  require 'new_relic/agent/transaction/pop'
6
6
  require 'new_relic/agent/transaction_timings'
7
7
 
8
- # A struct holding the information required to measure a controller
9
- # action. This is put on the thread local. Handles the issue of
10
- # re-entrancy, or nested action calls.
11
- #
12
- # This class is not part of the public API. Avoid making calls on it directly.
13
- #
14
8
  module NewRelic
15
9
  module Agent
10
+ # This class represents a single transaction (usually mapping to one
11
+ # web request or background job invocation) instrumented by the Ruby agent.
12
+ #
13
+ # @api public
16
14
  class Transaction
17
15
  # helper module refactored out of the `pop` method
18
16
  include Pop
@@ -377,6 +375,9 @@ module NewRelic
377
375
 
378
376
  # Returns truthy if the current in-progress transaction is considered a
379
377
  # a web transaction (as opposed to, e.g., a background transaction).
378
+ #
379
+ # @api public
380
+ #
380
381
  def self.recording_web_transaction?
381
382
  self.current && self.current.recording_web_transaction?
382
383
  end
@@ -9,10 +9,16 @@ module NewRelic
9
9
  class Transaction
10
10
  class DeveloperModeSampleBuffer < TransactionSampleBuffer
11
11
 
12
- MAX_SAMPLES = 100
12
+ CAPACITY = 100
13
13
 
14
- def max_samples
15
- MAX_SAMPLES
14
+ def capacity
15
+ max_capacity
16
+ end
17
+
18
+ # Dev mode is allowed more than the typical upper limit.
19
+ # Sidestep normal cap by overriding max_capacity.
20
+ def max_capacity
21
+ CAPACITY
16
22
  end
17
23
 
18
24
  def harvest_samples
@@ -23,9 +29,9 @@ module NewRelic
23
29
  Agent.config[:developer_mode]
24
30
  end
25
31
 
26
- # Truncate to the last max_samples we've received
32
+ # Truncate to the last capacity samples we've received
27
33
  def truncate_samples
28
- @samples = @samples.last(max_samples)
34
+ @samples = @samples.last(capacity)
29
35
  end
30
36
 
31
37
  # We don't hold onto previously trapped transactions on harvest