newrelic_rpm 2.8.8 → 2.8.9
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/lib/new_relic/agent/agent.rb +8 -5
- data/lib/new_relic/agent/samplers/memory.rb +2 -4
- data/lib/new_relic/config/rails.rb +3 -5
- data/lib/new_relic/local_environment.rb +2 -2
- data/lib/new_relic/shim_agent.rb +2 -1
- data/lib/new_relic/version.rb +8 -1
- data/lib/tasks/agent_tests.rake +9 -13
- data/newrelic.yml +1 -1
- data/ui/controllers/newrelic_controller.rb +1 -3
- metadata +2 -2
@@ -547,12 +547,15 @@ module NewRelic::Agent
|
|
547
547
|
end
|
548
548
|
|
549
549
|
def load_samplers
|
550
|
-
|
551
|
-
|
550
|
+
sampler_files_root = File.join(File.dirname(__FILE__), 'samplers')
|
551
|
+
samplers = %w[memory.rb]
|
552
|
+
samplers += %w[cpu.rb mongrel.rb] unless RUBY_PLATFORM =~ /java/
|
553
|
+
for sampler in samplers do
|
552
554
|
begin
|
553
|
-
|
555
|
+
log.debug "Loading sampler #{sampler}"
|
556
|
+
require File.join(sampler_files_root, sampler)
|
554
557
|
rescue => e
|
555
|
-
log.error "Error loading sampler '#{
|
558
|
+
log.error "Error loading sampler '#{sampler}': #{e}"
|
556
559
|
end
|
557
560
|
end
|
558
561
|
end
|
@@ -666,7 +669,7 @@ module NewRelic::Agent
|
|
666
669
|
uri = "/agent_listener/invoke_raw_method?method=#{method}&license_key=#{license_key}&protocol_version=#{PROTOCOL_VERSION}"
|
667
670
|
uri += "&run_id=#{@agent_id}" if @agent_id
|
668
671
|
|
669
|
-
request = Net::HTTP::Post.new(uri, 'ACCEPT-ENCODING' => 'gzip')
|
672
|
+
request = Net::HTTP::Post.new(uri, 'ACCEPT-ENCODING' => 'gzip', 'HOST' => config.fetch('host', 'collector.newrelic.com'))
|
670
673
|
request.content_type = "application/octet-stream"
|
671
674
|
request.body = post_data
|
672
675
|
|
@@ -16,10 +16,8 @@ module NewRelic::Agent
|
|
16
16
|
@ps = "/usr/bin/ps -o rss -p"
|
17
17
|
end
|
18
18
|
if !@ps
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
if @ps
|
19
|
+
NewRelic::Config.instance.log.warn "Unsupported platform for getting memory: #{platform}"
|
20
|
+
else
|
23
21
|
@broken = false
|
24
22
|
|
25
23
|
agent = NewRelic::Agent.instance
|
@@ -29,12 +29,10 @@ class NewRelic::Config::Rails < NewRelic::Config
|
|
29
29
|
def install_developer_mode(rails_config)
|
30
30
|
controller_path = File.join(newrelic_root, 'ui', 'controllers')
|
31
31
|
helper_path = File.join(newrelic_root, 'ui', 'helpers')
|
32
|
-
|
33
|
-
$LOAD_PATH << helper_path
|
34
|
-
|
32
|
+
|
35
33
|
if defined? ActiveSupport::Dependencies
|
36
|
-
|
37
|
-
|
34
|
+
Dir["#{helper_path}/*.rb"].each { |f| require f }
|
35
|
+
Dir["#{controller_path}/*.rb"].each { |f| require f }
|
38
36
|
elsif defined? Dependencies.load_paths
|
39
37
|
Dependencies.load_paths << controller_path
|
40
38
|
Dependencies.load_paths << helper_path
|
@@ -125,9 +125,9 @@ module NewRelic
|
|
125
125
|
require 'optparse'
|
126
126
|
# If nothing else is found, use the 3000 default
|
127
127
|
default_port = 3000
|
128
|
-
|
128
|
+
OptionParser.new do |opts|
|
129
129
|
opts.on("-p", "--port=port", String) { | default_port | }
|
130
|
-
opts.parse!
|
130
|
+
opts.parse!(ARGV.clone)
|
131
131
|
end
|
132
132
|
default_port
|
133
133
|
end
|
data/lib/new_relic/shim_agent.rb
CHANGED
data/lib/new_relic/version.rb
CHANGED
@@ -3,7 +3,7 @@ module NewRelic
|
|
3
3
|
module VERSION #:nodoc:
|
4
4
|
MAJOR = 2
|
5
5
|
MINOR = 8
|
6
|
-
TINY =
|
6
|
+
TINY = 9
|
7
7
|
STRING = [MAJOR, MINOR, TINY].join('.')
|
8
8
|
def self.changes
|
9
9
|
puts "NewRelic RPM Plugin Version: #{NewRelic::VERSION::STRING}"
|
@@ -11,6 +11,13 @@ module NewRelic
|
|
11
11
|
end
|
12
12
|
|
13
13
|
CHANGELOG = <<EOF
|
14
|
+
2009-04-17 version 2.8.9
|
15
|
+
* fix problem finding the newrelic controller in dev mode
|
16
|
+
* fix incompatibility with older versions of optparse
|
17
|
+
* fix potential jvm problem with jruby
|
18
|
+
* remove test:all task definition to avoid conflicts
|
19
|
+
* change error message about window sampler in windows not supported
|
20
|
+
to a warning message
|
14
21
|
2009-03-27 version 2.8.8
|
15
22
|
* fix error with jruby on windows
|
16
23
|
2009-03-20 version 2.8.7
|
data/lib/tasks/agent_tests.rake
CHANGED
@@ -1,17 +1,13 @@
|
|
1
1
|
# run unit tests for the NewRelic Agent
|
2
2
|
if defined? Rake::TestTask
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
3
|
+
namespace :test do
|
4
|
+
AGENT_HOME = File.expand_path(File.join(File.dirname(__FILE__), "..",".."))
|
5
|
+
Rake::TestTask.new(:newrelic) do |t|
|
6
|
+
t.libs << "#{AGENT_HOME}/test"
|
7
|
+
t.libs << "#{AGENT_HOME}/lib"
|
8
|
+
t.pattern = "#{AGENT_HOME}/test/**/tc_*.rb"
|
9
|
+
t.verbose = true
|
10
|
+
end
|
11
|
+
Rake::Task['test:newrelic'].comment = "Run the unit tests for the Agent"
|
11
12
|
end
|
12
|
-
Rake::Task['test:agent'].comment = "Run the unit tests for the Agent"
|
13
|
-
|
14
|
-
Rake::TestTask.new(:all => ["test", "test:agent"])
|
15
|
-
Rake::Task['test:all'].comment = "Run all tests including agent code"
|
16
|
-
end
|
17
13
|
end
|
data/newrelic.yml
CHANGED
@@ -47,7 +47,7 @@ common: &default_settings
|
|
47
47
|
# If a proxy is used, the host setting is required. Other settings are optional. Default
|
48
48
|
# port is 8080.
|
49
49
|
#
|
50
|
-
# proxy_host:
|
50
|
+
# proxy_host: proxyhostname
|
51
51
|
# proxy_port: 8080
|
52
52
|
# proxy_user:
|
53
53
|
# proxy_pass:
|
@@ -1,8 +1,6 @@
|
|
1
|
-
##require 'new_relic/agent'
|
2
|
-
require 'google_pie_chart'
|
3
|
-
|
4
1
|
class NewrelicController < ActionController::Base
|
5
2
|
include NewrelicHelper
|
3
|
+
helper NewrelicHelper
|
6
4
|
|
7
5
|
# See http://wiki.rubyonrails.org/rails/pages/Safe+ERB:
|
8
6
|
# We don't need to worry about checking taintedness
|
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: 2.8.
|
4
|
+
version: 2.8.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bill Kayser
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-04-17 00:00:00 -07:00
|
13
13
|
default_executable: newrelic_cmd
|
14
14
|
dependencies: []
|
15
15
|
|