newrelic_rpm 3.5.0 → 3.5.0.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of newrelic_rpm might be problematic. Click here for more details.

data/CHANGELOG CHANGED
@@ -5,6 +5,11 @@
5
5
  ## v3.5.1 ##
6
6
 
7
7
  ### current version ###
8
+ ## v3.5.0.1 ##
9
+
10
+ * (Fix) Due to a serious resource leak we have ended support for versions of Phusion Passenger
11
+ older than 2.1.1. Users of older versions are encouraged upgrade to a more recent version.
12
+
8
13
  ## v3.5.0 ##
9
14
 
10
15
  * (Fix) RUM Stops Working After 3.4.2.1 Agent Upgrade
@@ -35,6 +35,7 @@ module NewRelic
35
35
  :send_environment_info => true,
36
36
  :start_channel_listener => false,
37
37
  :data_report_period => 60,
38
+ :keep_retrying => true,
38
39
 
39
40
  :log_file_name => 'newrelic_agent.log',
40
41
  :log_file_path => 'log/',
@@ -27,21 +27,11 @@ module NewRelic
27
27
  attr_accessor :request
28
28
 
29
29
 
30
- @@check_server_connection = false
31
- def self.check_server_connection=(value)
32
- @@check_server_connection = value
33
- end
34
30
  # Return the currently active metric frame, or nil. Call with +true+
35
31
  # to create a new metric frame if one is not already on the thread.
36
32
  def self.current(create_if_empty=nil)
37
33
  f = Thread.current[:newrelic_metric_frame]
38
34
  return f if f || !create_if_empty
39
-
40
- # Reconnect to the server if necessary. This is only done
41
- # for old versions of passenger that don't implement an explicit after_fork
42
- # event.
43
- agent.after_fork(:keep_retrying => false) if @@check_server_connection
44
-
45
35
  Thread.current[:newrelic_metric_frame] = new
46
36
  end
47
37
 
@@ -1,19 +1,19 @@
1
1
  DependencyDetection.defer do
2
2
  @name = :passenger
3
-
3
+
4
4
  depends_on do
5
- defined?(PhusionPassenger)
5
+ defined?(::PhusionPassenger)
6
6
  end
7
7
 
8
8
  executes do
9
9
  NewRelic::Agent.logger.debug "Installing Passenger event hooks."
10
10
 
11
- PhusionPassenger.on_event(:stopping_worker_process) do
11
+ ::PhusionPassenger.on_event(:stopping_worker_process) do
12
12
  NewRelic::Agent.logger.debug "Passenger stopping this process, shutdown the agent."
13
13
  NewRelic::Agent.instance.shutdown
14
14
  end
15
15
 
16
- PhusionPassenger.on_event(:starting_worker_process) do |forked|
16
+ ::PhusionPassenger.on_event(:starting_worker_process) do |forked|
17
17
  # We want to reset the stats from the stats engine in case any carried
18
18
  # over into the spawned process. Don't clear them in case any were
19
19
  # cached. We do this even in conservative spawning.
@@ -21,17 +21,3 @@ DependencyDetection.defer do
21
21
  end
22
22
  end
23
23
  end
24
-
25
- DependencyDetection.defer do
26
- depends_on do
27
- defined?(::Passenger) && defined?(::Passenger::AbstractServer) || defined?(::IN_PHUSION_PASSENGER)
28
- end
29
-
30
- executes do
31
- ## We're on an older version of passenger
32
- ## FIXME: This warning is printing on current version of passenger
33
- # NewRelic::Agent.logger.warn "An older version of Phusion Passenger has been detected. We recommend using at least release 2.1.1."
34
-
35
- NewRelic::Agent::Instrumentation::MetricFrame.check_server_connection = true
36
- end
37
- end
@@ -14,7 +14,6 @@ module NewRelic
14
14
  #
15
15
  # NewRelic::LocalEnvironment should be accessed through NewRelic::Control#env (via the NewRelic::Control singleton).
16
16
  class LocalEnvironment
17
-
18
17
  # mongrel, thin, webrick, or possibly nil
19
18
  attr_accessor :dispatcher
20
19
  # used to distinguish instances of a dispatcher from each other, may be nil
@@ -23,7 +22,7 @@ module NewRelic
23
22
  attr_accessor :framework
24
23
  # The number of cpus, if detected, or nil - many platforms do not
25
24
  # support this :(
26
- attr_reader :processors
25
+ attr_reader :processors
27
26
  alias environment dispatcher
28
27
 
29
28
  def initialize
@@ -397,7 +396,7 @@ module NewRelic
397
396
  end
398
397
 
399
398
  def check_for_passenger
400
- if (defined?(::Passenger) && defined?(::Passenger::AbstractServer)) || defined?(::IN_PHUSION_PASSENGER)
399
+ if defined?(::PhusionPassenger)
401
400
  @dispatcher = :passenger
402
401
  end
403
402
  end
@@ -229,6 +229,9 @@ module NewRelic
229
229
  if params['d']
230
230
  @sql_segments.sort!{|a,b| b.duration <=> a.duration }
231
231
  end
232
+
233
+ sort_method = params['sort'] || :total_time
234
+ @profile_options = {:min_percent => 0.5, :sort_method => sort_method.to_sym}
232
235
 
233
236
  render(:show_sample)
234
237
  end
@@ -4,7 +4,7 @@ module NewRelic
4
4
  MAJOR = 3
5
5
  MINOR = 5
6
6
  TINY = 0
7
- BUILD = nil # Set to nil for a release, 'beta1', 'alpha', etc for prerelease builds
7
+ BUILD = 1 # Set to nil for a release, 'beta1', 'alpha', etc for prerelease builds
8
8
  STRING = [MAJOR, MINOR, TINY, BUILD].compact.join('.')
9
9
  end
10
10
 
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # This file configures the New Relic Ruby Agent, New Relic monitors
3
- # Rails applications with deep visibility and low overhead. For more
4
- # information, visit www.newrelic.com
3
+ # Rails applications with deep visibility and low overhead. For more
4
+ # information, visit www.newrelic.com.
5
5
  #
6
6
  # Generated <%= Time.now.strftime('%B %d, %Y') %>, for version <%= NewRelic::VERSION::STRING %>
7
7
  #
@@ -21,7 +21,7 @@ common: &default_settings
21
21
  # Use this setting to force the agent to run or not run.
22
22
  # Default is 'auto' which means the agent will install and run only
23
23
  # if a valid dispatcher such as Mongrel is running. This prevents
24
- # it from running with Rake or the console. Set to false to
24
+ # it from running with Rake or the console. Set to false to
25
25
  # completely turn the agent off regardless of the other settings.
26
26
  # Valid values are true, false and auto.
27
27
  #
@@ -47,7 +47,7 @@ common: &default_settings
47
47
  # When "true", the agent collects performance data about your
48
48
  # application and reports this data to the New Relic service at
49
49
  # newrelic.com. This global switch is normally overridden for each
50
- # environment below. (formerly called 'enabled')
50
+ # environment below (formerly called 'enabled').
51
51
  monitor_mode: true
52
52
 
53
53
  # Developer mode should be off in every environment but
@@ -55,7 +55,7 @@ common: &default_settings
55
55
  developer_mode: false
56
56
 
57
57
  # The newrelic agent generates its own log file to keep its logging
58
- # information separate from that of your application. Specify its
58
+ # information separate from that of your application. Specify its
59
59
  # log level here.
60
60
  log_level: info
61
61
 
@@ -101,7 +101,7 @@ common: &default_settings
101
101
  # Proxy settings for connecting to the service.
102
102
  #
103
103
  # If a proxy is used, the host setting is required. Other settings
104
- # are optional. Default port is 8080.
104
+ # are optional. Default port is 8080.
105
105
  #
106
106
  # proxy_host: hostname
107
107
  # proxy_port: 8080
@@ -141,13 +141,13 @@ common: &default_settings
141
141
  # When transaction tracer is on, SQL statements can optionally be
142
142
  # recorded. The recorder has three modes, "off" which sends no
143
143
  # SQL, "raw" which sends the SQL statement in its original form,
144
- # and "obfuscated", which strips out numeric and string literals
144
+ # and "obfuscated", which strips out numeric and string literals.
145
145
  record_sql: obfuscated
146
146
 
147
147
  # Threshold in seconds for when to collect stack trace for a SQL
148
148
  # call. In other words, when SQL statements exceed this threshold,
149
149
  # then capture and send the current stack trace. This is
150
- # helpful for pinpointing where long SQL calls originate from
150
+ # helpful for pinpointing where long SQL calls originate from.
151
151
  stack_trace_threshold: 0.500
152
152
 
153
153
  # Determines whether the agent will capture query plans for slow
@@ -160,12 +160,12 @@ common: &default_settings
160
160
  # explain_threshold: 0.5
161
161
 
162
162
  # Error collector captures information about uncaught exceptions and
163
- # sends them to the service for viewing
163
+ # sends them to the service for viewing.
164
164
  error_collector:
165
165
 
166
166
  # Error collector is enabled by default. Set this to false to turn
167
167
  # it off. This feature is only available at the Professional and above
168
- # product levels
168
+ # product levels.
169
169
  enabled: true
170
170
 
171
171
  # Rails Only - tells error collector whether or not to capture a
@@ -176,12 +176,11 @@ common: &default_settings
176
176
  # To stop specific errors from reporting to New Relic, set this property
177
177
  # to comma separated values. Default is to ignore routing errors
178
178
  # which are how 404's get triggered.
179
- #
180
179
  ignore_errors: ActionController::RoutingError
181
180
 
182
181
  # (Advanced) Uncomment this to ensure the cpu and memory samplers
183
- # won't run. Useful when you are using the agent to monitor an
184
- # external resource
182
+ # won't run. Useful when you are using the agent to monitor an
183
+ # external resource.
185
184
  # disable_samplers: true
186
185
 
187
186
  # If you aren't interested in visibility in these areas, you can
@@ -232,16 +231,16 @@ test:
232
231
  # unit, functional or integration tests or the like.
233
232
  monitor_mode: false
234
233
 
235
- # Turn on the agent in production for 24x7 monitoring. NewRelic
234
+ # Turn on the agent in production for 24x7 monitoring. NewRelic
236
235
  # testing shows an average performance impact of < 5 ms per
237
- # transaction, you you can leave this on all the time without
236
+ # transaction, you can leave this on all the time without
238
237
  # incurring any user-visible performance degradation.
239
238
  production:
240
239
  <<: *default_settings
241
240
  monitor_mode: true
242
241
 
243
242
  # Many applications have a staging environment which behaves
244
- # identically to production. Support for that environment is provided
243
+ # identically to production. Support for that environment is provided
245
244
  # here. By default, the staging environment has the agent turned on.
246
245
  staging:
247
246
  <<: *default_settings
@@ -4,14 +4,20 @@
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = "newrelic_rpm"
8
- s.version = "3.5.0"
7
+ s.name = %q{newrelic_rpm}
8
+ s.version = "3.5.0.1"
9
9
 
10
10
  s.authors = ["Bill Kayser", "Jon Guymon", "Justin George", "Darin Swanson", "Rob Saul"]
11
- s.date = "2012-10-04"
12
- s.description = "New Relic is a performance management system, developed by New Relic,\nInc (http://www.newrelic.com). New Relic provides you with deep\ninformation about the performance of your web application as it runs\nin production. The New Relic Ruby Agent is dual-purposed as a either a\nGem or plugin, hosted on\nhttp://github.com/newrelic/rpm/\n"
13
- s.email = "support@newrelic.com"
14
- s.executables = ["newrelic_cmd", "newrelic", "mongrel_rpm"]
11
+ s.date = %q{2012-10-22}
12
+ s.description = %q{New Relic is a performance management system, developed by New Relic,
13
+ Inc (http://www.newrelic.com). New Relic provides you with deep
14
+ information about the performance of your web application as it runs
15
+ in production. The New Relic Ruby Agent is dual-purposed as a either a
16
+ Gem or plugin, hosted on
17
+ http://github.com/newrelic/rpm/
18
+ }
19
+ s.email = %q{support@newrelic.com}
20
+ s.executables = ["newrelic", "mongrel_rpm", "newrelic_cmd"]
15
21
  s.extra_rdoc_files = [
16
22
  "CHANGELOG",
17
23
  "LICENSE",
@@ -306,8 +312,28 @@ Gem::Specification.new do |s|
306
312
  "vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/web_service.rb",
307
313
  "vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/web_transaction.rb"
308
314
  ]
309
- s.homepage = "http://www.github.com/newrelic/rpm"
310
- s.post_install_message = "\nPLEASE NOTE:\n\nDeveloper Mode is now a Rack middleware.\n\nDeveloper Mode is no longer available in Rails 2.1 and earlier.\nHowever, starting in version 2.12 you can use Developer Mode in any\nRack based framework, in addition to Rails. To install developer mode\nin a non-Rails application, just add NewRelic::Rack::DeveloperMode to\nyour middleware stack.\n\nIf you are using JRuby, we recommend using at least version 1.4 or \nlater because of issues with the implementation of the timeout library.\n\nRefer to the README.md file for more information.\n\nPlease see http://github.com/newrelic/rpm/blob/master/CHANGELOG\nfor a complete description of the features and enhancements available\nin version 3.5 of the Ruby Agent.\n \n"
315
+ s.homepage = %q{http://www.github.com/newrelic/rpm}
316
+ s.post_install_message = %q{
317
+ PLEASE NOTE:
318
+
319
+ Developer Mode is now a Rack middleware.
320
+
321
+ Developer Mode is no longer available in Rails 2.1 and earlier.
322
+ However, starting in version 2.12 you can use Developer Mode in any
323
+ Rack based framework, in addition to Rails. To install developer mode
324
+ in a non-Rails application, just add NewRelic::Rack::DeveloperMode to
325
+ your middleware stack.
326
+
327
+ If you are using JRuby, we recommend using at least version 1.4 or
328
+ later because of issues with the implementation of the timeout library.
329
+
330
+ Refer to the README.md file for more information.
331
+
332
+ Please see http://github.com/newrelic/rpm/blob/master/CHANGELOG
333
+ for a complete description of the features and enhancements available
334
+ in version 3.5 of the Ruby Agent.
335
+
336
+ }
311
337
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "New Relic Ruby Agent"]
312
338
  s.require_paths = ["lib"]
313
339
  s.summary = "New Relic Ruby Agent"
@@ -28,8 +28,7 @@ class NewRelic::LocalEnvironmentTest < Test::Unit::TestCase
28
28
 
29
29
  def test_passenger
30
30
  class << self
31
- module ::Passenger
32
- const_set "AbstractServer", 0
31
+ module ::PhusionPassenger
33
32
  end
34
33
  end
35
34
  e = NewRelic::LocalEnvironment.new
@@ -42,9 +41,9 @@ class NewRelic::LocalEnvironmentTest < Test::Unit::TestCase
42
41
  assert_nil e.dispatcher_instance_id
43
42
  end
44
43
 
45
- ::Passenger.class_eval { remove_const :AbstractServer }
44
+ Object.send(:remove_const, :PhusionPassenger)
46
45
  end
47
-
46
+
48
47
  def test_snapshot
49
48
  e = NewRelic::LocalEnvironment.new
50
49
  s = e.snapshot
@@ -343,10 +343,25 @@ module NewRelic::DeveloperModeHelper
343
343
  parts.join '.'
344
344
  end
345
345
 
346
- def profile_table(profile)
346
+ SORT_REPLACEMENTS = {
347
+ "Total" => :total_time,
348
+ "Self" => :self_time,
349
+ "Child" => :children_time,
350
+ "Wait" => :wait_time
351
+ }
352
+
353
+ def profile_table(sample, options)
347
354
  out = StringIO.new
348
- printer = RubyProf::GraphHtmlPrinter.new(profile)
349
- printer.print(out, :min_percent=>0.5)
350
- out.string[/<body>(.*)<\/body>/im, 0].gsub('<table>', '<table class=profile>')
355
+ printer = RubyProf::GraphHtmlPrinter.new(sample.profile)
356
+ printer.print(out, options)
357
+ out = out.string[/<body>(.*)<\/body>/im, 0].gsub('<table>', '<table class=profile>')
358
+ SORT_REPLACEMENTS.each do |text, param|
359
+ replacement = (options[:sort_method] == param) ?
360
+ "<th> #{text}&nbsp;&darr;</th>" :
361
+ "<th>#{link_to text, "show_sample_summary?id=#{sample.sample_id}&sort=#{param}"}</th>"
362
+
363
+ out.gsub!(/<th> +#{text}<\/th>/, replacement)
364
+ end
365
+ out
351
366
  end
352
367
  end
@@ -62,7 +62,7 @@
62
62
  <br/>
63
63
  <div id="view_sample">
64
64
  <% if @sample.profile %>
65
- <%= profile_table(@sample.profile) %>
65
+ <%= profile_table(@sample, @profile_options) %>
66
66
  <% else %>
67
67
  <div align=center width="100%">
68
68
  <%= show_view_link 'Summary', 'show_sample_summary' %>
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: newrelic_rpm
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 85
5
5
  prerelease:
6
6
  segments:
7
7
  - 3
8
8
  - 5
9
9
  - 0
10
- version: 3.5.0
10
+ - 1
11
+ version: 3.5.0.1
11
12
  platform: ruby
12
13
  authors:
13
14
  - Bill Kayser
@@ -19,7 +20,8 @@ autorequire:
19
20
  bindir: bin
20
21
  cert_chain: []
21
22
 
22
- date: 2012-10-04 00:00:00 Z
23
+ date: 2012-10-22 00:00:00 -07:00
24
+ default_executable:
23
25
  dependencies:
24
26
  - !ruby/object:Gem::Dependency
25
27
  name: jeweler
@@ -73,9 +75,9 @@ description: |
73
75
 
74
76
  email: support@newrelic.com
75
77
  executables:
76
- - newrelic_cmd
77
78
  - newrelic
78
79
  - mongrel_rpm
80
+ - newrelic_cmd
79
81
  extensions: []
80
82
 
81
83
  extra_rdoc_files:
@@ -370,6 +372,7 @@ files:
370
372
  - vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/web_frontend.rb
371
373
  - vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/web_service.rb
372
374
  - vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/web_transaction.rb
375
+ has_rdoc: true
373
376
  homepage: http://www.github.com/newrelic/rpm
374
377
  licenses: []
375
378
 
@@ -423,7 +426,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
423
426
  requirements: []
424
427
 
425
428
  rubyforge_project:
426
- rubygems_version: 1.8.24
429
+ rubygems_version: 1.6.2
427
430
  signing_key:
428
431
  specification_version: 3
429
432
  summary: New Relic Ruby Agent