newrelic_rpm 4.0.0.332 → 4.1.0.333
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +0 -1
- data/CHANGELOG.md +22 -0
- data/LICENSE +1 -27
- data/README.md +4 -57
- data/lib/new_relic/agent.rb +0 -1
- data/lib/new_relic/agent/attribute_filter.rb +0 -1
- data/lib/new_relic/agent/configuration/default_source.rb +3 -32
- data/lib/new_relic/agent/error_collector.rb +0 -2
- data/lib/new_relic/agent/http_clients/curb_wrappers.rb +1 -1
- data/lib/new_relic/agent/http_clients/typhoeus_wrappers.rb +1 -1
- data/lib/new_relic/agent/http_clients/uri_util.rb +12 -7
- data/lib/new_relic/agent/stats.rb +0 -14
- data/lib/new_relic/agent/stats_engine.rb +171 -3
- data/lib/new_relic/agent/supported_versions.rb +9 -9
- data/lib/new_relic/agent/traced_method_stack.rb +1 -1
- data/lib/new_relic/agent/transaction/attributes.rb +0 -2
- data/lib/new_relic/agent/transaction/external_request_segment.rb +1 -5
- data/lib/new_relic/agent/transaction/trace_node.rb +0 -10
- data/lib/new_relic/agent/transaction_sample_builder.rb +0 -3
- data/lib/new_relic/agent/transaction_sampler.rb +3 -13
- data/lib/new_relic/collection_helper.rb +0 -18
- data/lib/new_relic/control/frameworks/rails.rb +1 -21
- data/lib/new_relic/control/frameworks/rails3.rb +1 -1
- data/lib/new_relic/noticed_error.rb +1 -0
- data/lib/new_relic/version.rb +1 -1
- data/newrelic.yml +0 -4
- data/newrelic_rpm.gemspec +1 -1
- data/test/config/newrelic.yml +1 -1
- data/test/multiverse/lib/multiverse/runner.rb +9 -1
- data/test/multiverse/suites/active_record/config/newrelic.yml +0 -1
- data/test/multiverse/suites/agent_only/config/newrelic.yml +0 -1
- data/test/multiverse/suites/capistrano/config/newrelic.yml +0 -1
- data/test/multiverse/suites/capistrano2/config/newrelic.yml +0 -1
- data/test/multiverse/suites/curb/config/newrelic.yml +0 -1
- data/test/multiverse/suites/datamapper/config/newrelic.yml +0 -1
- data/test/multiverse/suites/deferred_instrumentation/config/newrelic.yml +0 -1
- data/test/multiverse/suites/delayed_job/config/newrelic.yml +0 -1
- data/test/multiverse/suites/excon/config/newrelic.yml +0 -1
- data/test/multiverse/suites/grape/config/newrelic.yml +0 -1
- data/test/multiverse/suites/high_security/config/newrelic.yml +0 -1
- data/test/multiverse/suites/httpclient/config/newrelic.yml +0 -1
- data/test/multiverse/suites/httprb/config/newrelic.yml +0 -1
- data/test/multiverse/suites/json/config/newrelic.yml +0 -1
- data/test/multiverse/suites/marshalling/config/newrelic.yml +0 -1
- data/test/multiverse/suites/mongo/config/newrelic.yml +0 -1
- data/test/multiverse/suites/net_http/config/newrelic.yml +0 -1
- data/test/multiverse/suites/padrino/config/newrelic.yml +0 -1
- data/test/multiverse/suites/rack/config/newrelic.yml +0 -1
- data/test/multiverse/suites/rails/config/newrelic.yml +0 -1
- data/test/multiverse/suites/rake/config/newrelic.yml +0 -1
- data/test/multiverse/suites/redis/config/newrelic.yml +0 -1
- data/test/multiverse/suites/resque/config/newrelic.yml +0 -1
- data/test/multiverse/suites/sequel/config/newrelic.yml +0 -1
- data/test/multiverse/suites/sidekiq/config/newrelic.yml +0 -1
- data/test/multiverse/suites/sinatra/config/newrelic.yml +0 -1
- data/test/multiverse/suites/typhoeus/config/newrelic.yml +0 -1
- data/test/multiverse/suites/yajl/config/newrelic.yml +0 -1
- data/test/multiverse/test/suite_examples/one/a/config/newrelic.yml +0 -1
- data/test/multiverse/test/suite_examples/one/b/config/newrelic.yml +0 -1
- data/test/new_relic/agent/agent/connect_test.rb +3 -12
- data/test/new_relic/agent/agent/start_test.rb +4 -2
- data/test/new_relic/agent/busy_calculator_test.rb +13 -5
- data/test/new_relic/agent/pipe_channel_manager_test.rb +3 -4
- data/test/new_relic/agent/stats_engine_test.rb +313 -1
- data/test/new_relic/agent/stats_test.rb +0 -20
- data/test/new_relic/agent/traced_method_stack_test.rb +2 -5
- data/test/new_relic/agent/transaction/external_request_segment_test.rb +5 -0
- data/test/new_relic/agent/transaction/trace_node_test.rb +0 -19
- data/test/new_relic/agent/transaction_sampler_test.rb +3 -6
- data/test/new_relic/collection_helper_test.rb +0 -39
- data/test/new_relic/control_test.rb +2 -4
- data/test/new_relic/license_test.rb +4 -14
- data/test/performance/suites/external_segment.rb +0 -2
- data/test/performance/suites/rack_middleware.rb +1 -3
- data/test/performance/suites/transaction_tracing.rb +0 -1
- metadata +2 -94
- data/lib/conditional_vendored_metric_parser.rb +0 -9
- data/lib/new_relic/agent/instrumentation/rubyprof.rb +0 -26
- data/lib/new_relic/agent/stats_engine/metric_stats.rb +0 -188
- data/lib/new_relic/agent/transaction/developer_mode_sample_buffer.rb +0 -62
- data/lib/new_relic/merbtasks.rb +0 -10
- data/lib/new_relic/rack/developer_mode.rb +0 -321
- data/lib/new_relic/rack/developer_mode/segment_summary.rb +0 -56
- data/test/new_relic/agent/stats_engine/metric_stats_test.rb +0 -328
- data/test/new_relic/agent/transaction/developer_mode_sample_buffer_test.rb +0 -75
- data/test/new_relic/metric_parser/metric_parser_test.rb +0 -17
- data/test/new_relic/rack/developer_mode/segment_summary_test.rb +0 -96
- data/test/new_relic/rack/developer_mode_helper_test.rb +0 -136
- data/test/new_relic/rack/developer_mode_test.rb +0 -96
- data/ui/helpers/developer_mode_helper.rb +0 -325
- data/ui/helpers/google_pie_chart.rb +0 -54
- data/ui/views/layouts/newrelic_default.rhtml +0 -48
- data/ui/views/newrelic/_explain_plans.rhtml +0 -27
- data/ui/views/newrelic/_sample.rhtml +0 -20
- data/ui/views/newrelic/_segment.rhtml +0 -28
- data/ui/views/newrelic/_segment_limit_message.rhtml +0 -1
- data/ui/views/newrelic/_segment_row.rhtml +0 -12
- data/ui/views/newrelic/_show_sample_detail.rhtml +0 -24
- data/ui/views/newrelic/_show_sample_sql.rhtml +0 -24
- data/ui/views/newrelic/_show_sample_summary.rhtml +0 -3
- data/ui/views/newrelic/_sql_row.rhtml +0 -16
- data/ui/views/newrelic/_stack_trace.rhtml +0 -15
- data/ui/views/newrelic/_table.rhtml +0 -12
- data/ui/views/newrelic/explain_sql.rhtml +0 -43
- data/ui/views/newrelic/file/images/arrow-close.png +0 -0
- data/ui/views/newrelic/file/images/arrow-open.png +0 -0
- data/ui/views/newrelic/file/images/blue_bar.gif +0 -0
- data/ui/views/newrelic/file/images/file_icon.png +0 -0
- data/ui/views/newrelic/file/images/gray_bar.gif +0 -0
- data/ui/views/newrelic/file/images/new-relic-rpm-desktop.gif +0 -0
- data/ui/views/newrelic/file/images/new_relic_rpm_desktop.gif +0 -0
- data/ui/views/newrelic/file/images/textmate.png +0 -0
- data/ui/views/newrelic/file/javascript/jquery-1.4.2.js +0 -6243
- data/ui/views/newrelic/file/javascript/transaction_sample.js +0 -123
- data/ui/views/newrelic/file/stylesheets/style.css +0 -490
- data/ui/views/newrelic/index.rhtml +0 -70
- data/ui/views/newrelic/sample_not_found.rhtml +0 -2
- data/ui/views/newrelic/show_sample.rhtml +0 -81
- data/ui/views/newrelic/threads.rhtml +0 -45
- data/vendor/gems/metric_parser-0.1.0.pre1/.specification +0 -116
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/metric_parser.rb +0 -5
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser.rb +0 -70
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/action_mailer.rb +0 -18
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/active_merchant.rb +0 -35
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/active_record.rb +0 -37
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/apdex.rb +0 -93
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/background_transaction.rb +0 -11
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/client.rb +0 -50
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/controller.rb +0 -71
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/controller_cpu.rb +0 -47
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/controller_ext.rb +0 -21
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/database.rb +0 -52
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/database_pool.rb +0 -28
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/dot_net.rb +0 -32
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/dot_net_parser.rb +0 -21
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/errors.rb +0 -15
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/external.rb +0 -59
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/frontend.rb +0 -44
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/gc.rb +0 -24
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/hibernate_session.rb +0 -11
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/java.rb +0 -35
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/java_parser.rb +0 -21
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/jsp.rb +0 -38
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/jsp_tag.rb +0 -11
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/mem_cache.rb +0 -56
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/metric_parser.rb +0 -138
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/middleware.rb +0 -33
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/nested.rb +0 -23
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/orm.rb +0 -31
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/other_transaction.rb +0 -44
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/servlet.rb +0 -11
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/servlet_context_listener.rb +0 -11
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/servlet_filter.rb +0 -11
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/servlet_init.rb +0 -11
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/solr.rb +0 -31
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/solr_request_handler.rb +0 -19
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/spring.rb +0 -58
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/spring_controller.rb +0 -10
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/spring_view.rb +0 -10
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/struts_action.rb +0 -24
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/struts_result.rb +0 -24
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/version.rb +0 -9
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/view.rb +0 -74
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/web_frontend.rb +0 -22
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/web_service.rb +0 -18
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/web_transaction.rb +0 -137
@@ -11,22 +11,22 @@ module NewRelic
|
|
11
11
|
{
|
12
12
|
:type => :ruby,
|
13
13
|
:name => "MRI",
|
14
|
-
:supported => ["2.0.0", "~>
|
14
|
+
:supported => ["2.0.0", "~>2.1.0", "~>2.2.0", "~>2.3.0", "~>2.4.0"],
|
15
15
|
:deprecated => ["1.8.6", "1.8.7", "1.9.2", "1.9.3"],
|
16
16
|
:url => "https://www.ruby-lang.org",
|
17
17
|
:feed => "https://www.ruby-lang.org/en/feeds/news.rss",
|
18
|
-
:notes => ["Last supported agent for 1.8.7, 1.9.2, and 1.9.3 was 3.18.
|
18
|
+
:notes => ["Last supported agent for 1.8.7, 1.9.2, and 1.9.3 was 3.18.1.330.",
|
19
19
|
"Last supported agent on 1.8.6 was 3.6.8.168."]
|
20
20
|
},
|
21
21
|
:jruby =>
|
22
22
|
{
|
23
23
|
:type => :ruby,
|
24
24
|
:name => "JRuby",
|
25
|
-
:supported => ["~>
|
26
|
-
:deprecated => ["~>
|
25
|
+
:supported => ["~>9.0", "~>9.1"],
|
26
|
+
:deprecated => ["~>1.7.0"],
|
27
27
|
:url => "http://jruby.org",
|
28
28
|
:feed => "http://jruby.org/atom.xml",
|
29
|
-
:notes => ["Last supported agent for ~>
|
29
|
+
:notes => ["Last supported agent for ~>1.7.0 was 3.18.1.330."]
|
30
30
|
},
|
31
31
|
|
32
32
|
# App servers
|
@@ -78,11 +78,11 @@ module NewRelic
|
|
78
78
|
:rails =>
|
79
79
|
{
|
80
80
|
:type => :web,
|
81
|
-
:supported => ["~3.0.0", "~>3.1.0", "~>3.2.0", "~>4.0.0", "~>4.1.0", "~>4.2.0", "~>
|
81
|
+
:supported => ["~3.0.0", "~>3.1.0", "~>3.2.0", "~>4.0.0", "~>4.1.0", "~>4.2.0", "~>5.0.0"],
|
82
82
|
:deprecated => ["~>2.0.0", "~>2.1.0", "~>2.2.0", "~>2.3.0"],
|
83
83
|
:url => "https://rubygems.org/gems/rails",
|
84
84
|
:feed => "https://rubygems.org/gems/rails/versions.atom",
|
85
|
-
:notes => ["Last supported agent for ~>2.1.0, ~>2.2.0, and ~>2.3.0 was 3.18.
|
85
|
+
:notes => ["Last supported agent for ~>2.1.0, ~>2.2.0, and ~>2.3.0 was 3.18.1.330.",
|
86
86
|
"Last supported agent for 2.0.x was 3.6.8.168."]
|
87
87
|
},
|
88
88
|
:sinatra =>
|
@@ -149,7 +149,7 @@ module NewRelic
|
|
149
149
|
:redis =>
|
150
150
|
{
|
151
151
|
:type => :database,
|
152
|
-
:supported => ["~>
|
152
|
+
:supported => ["~>3.0"],
|
153
153
|
:url => "https://rubygems.org/gems/redis",
|
154
154
|
:feed => "https://rubygems.org/gems/redis/versions.atom"
|
155
155
|
},
|
@@ -158,7 +158,7 @@ module NewRelic
|
|
158
158
|
:rake =>
|
159
159
|
{
|
160
160
|
:type => :background,
|
161
|
-
:supported => ["~>
|
161
|
+
:supported => ["~>10.0"],
|
162
162
|
:url => "https://rubygems.org/gems/rake",
|
163
163
|
:feed => "https://rubygems.org/gems/rake/versions.atom"
|
164
164
|
},
|
@@ -122,8 +122,6 @@ module NewRelic
|
|
122
122
|
# Avoid allocating anything if there are no attrs at all
|
123
123
|
return EMPTY_HASH if attributes.empty?
|
124
124
|
|
125
|
-
return attributes.dup if destination == NewRelic::Agent::AttributeFilter::DST_DEVELOPER_MODE
|
126
|
-
|
127
125
|
attributes.inject({}) do |memo, (key, value)|
|
128
126
|
if @filter.allows?(calculated_destinations[key], destination)
|
129
127
|
memo[key] = value
|
@@ -13,7 +13,7 @@ module NewRelic
|
|
13
13
|
|
14
14
|
def initialize library, uri, procedure
|
15
15
|
@library = library
|
16
|
-
@uri =
|
16
|
+
@uri = HTTPClients::URIUtil.parse_and_normalize_url(uri)
|
17
17
|
@procedure = procedure
|
18
18
|
@host_header = nil
|
19
19
|
@app_data = nil
|
@@ -90,10 +90,6 @@ module NewRelic
|
|
90
90
|
Agent.instance.transaction_sampler.add_node_parameters node_params
|
91
91
|
end
|
92
92
|
|
93
|
-
def normalize_uri uri
|
94
|
-
uri.is_a?(URI) ? uri : HTTPClients::URIUtil.parse_url(uri)
|
95
|
-
end
|
96
|
-
|
97
93
|
def process_host_header request
|
98
94
|
if @host_header = request.host_from_header
|
99
95
|
update_segment_name
|
@@ -146,16 +146,6 @@ module NewRelic
|
|
146
146
|
summary.current_nest_count -= 1 if summary
|
147
147
|
end
|
148
148
|
|
149
|
-
# This is only for use by developer mode
|
150
|
-
def find_node(id)
|
151
|
-
return self if object_id == id
|
152
|
-
called_nodes.each do |node|
|
153
|
-
found = node.find_node(id)
|
154
|
-
return found if found
|
155
|
-
end
|
156
|
-
nil
|
157
|
-
end
|
158
|
-
|
159
149
|
def explain_sql
|
160
150
|
return params[:explain_plan] if params.key?(:explain_plan)
|
161
151
|
|
@@ -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/collection_helper'
|
6
5
|
require 'new_relic/agent/transaction'
|
7
6
|
require 'new_relic/agent/transaction/trace'
|
8
7
|
|
@@ -44,8 +43,6 @@ module NewRelic
|
|
44
43
|
|
45
44
|
attr_reader :current_node, :sample
|
46
45
|
|
47
|
-
include NewRelic::CollectionHelper
|
48
|
-
|
49
46
|
def initialize(time=Time.now)
|
50
47
|
@sample = NewRelic::Agent::Transaction::Trace.new(time.to_f)
|
51
48
|
@sample_start = time.to_f
|
@@ -3,7 +3,6 @@
|
|
3
3
|
# See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.
|
4
4
|
|
5
5
|
require 'new_relic/agent/transaction_sample_builder'
|
6
|
-
require 'new_relic/agent/transaction/developer_mode_sample_buffer'
|
7
6
|
require 'new_relic/agent/transaction/slowest_sample_buffer'
|
8
7
|
require 'new_relic/agent/transaction/synthetics_sample_buffer'
|
9
8
|
require 'new_relic/agent/transaction/xray_sample_buffer'
|
@@ -20,14 +19,12 @@ module NewRelic
|
|
20
19
|
#
|
21
20
|
# @api public
|
22
21
|
class TransactionSampler
|
23
|
-
attr_reader :last_sample, :
|
22
|
+
attr_reader :last_sample, :xray_sample_buffer
|
24
23
|
|
25
24
|
def initialize
|
26
|
-
@dev_mode_sample_buffer = NewRelic::Agent::Transaction::DeveloperModeSampleBuffer.new
|
27
25
|
@xray_sample_buffer = NewRelic::Agent::Transaction::XraySampleBuffer.new
|
28
26
|
|
29
27
|
@sample_buffers = []
|
30
|
-
@sample_buffers << @dev_mode_sample_buffer
|
31
28
|
@sample_buffers << @xray_sample_buffer
|
32
29
|
@sample_buffers << NewRelic::Agent::Transaction::SlowestSampleBuffer.new
|
33
30
|
@sample_buffers << NewRelic::Agent::Transaction::SyntheticsSampleBuffer.new
|
@@ -54,7 +51,7 @@ module NewRelic
|
|
54
51
|
end
|
55
52
|
|
56
53
|
def enabled?
|
57
|
-
Agent.config[:'transaction_tracer.enabled']
|
54
|
+
Agent.config[:'transaction_tracer.enabled']
|
58
55
|
end
|
59
56
|
|
60
57
|
def on_start_transaction(state, start_time)
|
@@ -65,18 +62,11 @@ module NewRelic
|
|
65
62
|
|
66
63
|
# This delegates to the builder to create a new open transaction node
|
67
64
|
# for the frame, beginning at the optionally specified time.
|
68
|
-
#
|
69
|
-
# Note that in developer mode, this captures a stacktrace for
|
70
|
-
# the beginning of each node, which can be fairly slow
|
71
65
|
def notice_push_frame(state, time=Time.now)
|
72
66
|
builder = state.transaction_sample_builder
|
73
67
|
return unless builder
|
74
68
|
|
75
|
-
|
76
|
-
if @dev_mode_sample_buffer
|
77
|
-
@dev_mode_sample_buffer.visit_node(node)
|
78
|
-
end
|
79
|
-
node
|
69
|
+
builder.trace_entry(time.to_f)
|
80
70
|
end
|
81
71
|
|
82
72
|
# Informs the transaction sample builder about the end of a traced frame
|
@@ -31,24 +31,6 @@ module NewRelic
|
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
|
-
# Return an array of strings (backtrace), cleaned up for readability
|
35
|
-
# Return nil if there is no backtrace
|
36
|
-
|
37
|
-
def strip_nr_from_backtrace(backtrace)
|
38
|
-
if backtrace && !Agent.config[:disable_backtrace_cleanup]
|
39
|
-
# this is for 1.9.1, where strings no longer have Enumerable
|
40
|
-
backtrace = backtrace.split("\n") if String === backtrace
|
41
|
-
backtrace = backtrace.map(&:to_s)
|
42
|
-
backtrace = backtrace.reject do |line|
|
43
|
-
line.include?(NewRelic::Control.newrelic_root) or
|
44
|
-
line =~ /^newrelic_rpm\s/
|
45
|
-
end
|
46
|
-
# rename methods back to their original state
|
47
|
-
backtrace = backtrace.collect {|line| line.gsub(/_without_(newrelic|trace)/, "")}
|
48
|
-
end
|
49
|
-
backtrace
|
50
|
-
end
|
51
|
-
|
52
34
|
private
|
53
35
|
|
54
36
|
# Convert any kind of object to a short string.
|
@@ -12,7 +12,7 @@ module NewRelic
|
|
12
12
|
class Rails < NewRelic::Control::Frameworks::Ruby
|
13
13
|
|
14
14
|
def env
|
15
|
-
@env ||= RAILS_ENV.dup
|
15
|
+
@env ||= ( ENV['NEW_RELIC_ENV'] || RAILS_ENV.dup )
|
16
16
|
end
|
17
17
|
|
18
18
|
# Rails can return an empty string from this method, causing
|
@@ -58,7 +58,6 @@ module NewRelic
|
|
58
58
|
# is running, if it thinks it's a rake task, or if the agent_enabled is false.
|
59
59
|
::NewRelic::Agent.logger.info("New Relic Agent not running.")
|
60
60
|
else
|
61
|
-
install_developer_mode(rails_config) if Agent.config[:developer_mode]
|
62
61
|
install_browser_monitoring(rails_config)
|
63
62
|
install_agent_hooks(rails_config)
|
64
63
|
end
|
@@ -95,25 +94,6 @@ module NewRelic
|
|
95
94
|
end
|
96
95
|
end
|
97
96
|
|
98
|
-
def install_developer_mode(rails_config)
|
99
|
-
return if defined?(@developer_mode_installed) && @developer_mode_installed
|
100
|
-
@developer_mode_installed = true
|
101
|
-
if rails_config && rails_config.respond_to?(:middleware)
|
102
|
-
begin
|
103
|
-
require 'new_relic/rack/developer_mode'
|
104
|
-
rails_config.middleware.use NewRelic::Rack::DeveloperMode
|
105
|
-
::NewRelic::Agent.logger.info("New Relic Agent Developer Mode enabled.")
|
106
|
-
if env == "production"
|
107
|
-
::NewRelic::Agent.logger.warn("***New Relic Developer Mode is not intended to be enabled in production environments! We highly recommend setting developer_mode: false for the production environment in your newrelic.yml.")
|
108
|
-
end
|
109
|
-
rescue => e
|
110
|
-
::NewRelic::Agent.logger.warn("Error installing New Relic Developer Mode", e)
|
111
|
-
end
|
112
|
-
elsif rails_config
|
113
|
-
::NewRelic::Agent.logger.warn("Developer mode not available for Rails versions prior to 2.2")
|
114
|
-
end
|
115
|
-
end
|
116
|
-
|
117
97
|
def rails_version
|
118
98
|
@rails_version ||= Gem::Version.new(::Rails::VERSION::STRING)
|
119
99
|
end
|
data/lib/new_relic/version.rb
CHANGED
data/newrelic.yml
CHANGED
@@ -30,10 +30,6 @@ development:
|
|
30
30
|
<<: *default_settings
|
31
31
|
app_name: <%= app_name %> (Development)
|
32
32
|
|
33
|
-
# NOTE: There is substantial overhead when running in developer mode.
|
34
|
-
# Do not use for production or load testing.
|
35
|
-
developer_mode: true
|
36
|
-
|
37
33
|
test:
|
38
34
|
<<: *default_settings
|
39
35
|
# It doesn't make sense to report to New Relic from automated test runs.
|
data/newrelic_rpm.gemspec
CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
|
|
12
12
|
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
|
13
13
|
s.authors = [ "Tim Krajcar", "Matthew Wear", "Katherine Wu", "Kenichi Nakamura" ]
|
14
14
|
s.date = Time.now.strftime('%Y-%m-%d')
|
15
|
-
s.licenses = ['New Relic'
|
15
|
+
s.licenses = ['New Relic']
|
16
16
|
s.description = <<-EOS
|
17
17
|
New Relic is a performance management system, developed by New Relic,
|
18
18
|
Inc (http://www.newrelic.com). New Relic provides you with deep
|
data/test/config/newrelic.yml
CHANGED
@@ -91,14 +91,22 @@ module Multiverse
|
|
91
91
|
"rails" => ["active_record", "rails"],
|
92
92
|
"serialization" => ["json", "marshalling", "yajl"],
|
93
93
|
"sinatra" => ["sinatra", "padrino"],
|
94
|
-
"background_2" => ["
|
94
|
+
"background_2" => ["resque"],
|
95
95
|
|
96
96
|
"rest" => [] # Specially handled below
|
97
97
|
}
|
98
98
|
|
99
|
+
# Would like to reinstate but requires investigation, see RUBY-1749
|
100
|
+
unless RUBY_VERSION >= '2.1' and RUBY_VERSION < '2.3'
|
101
|
+
GROUPS['background_2'] << 'rake'
|
102
|
+
end
|
103
|
+
|
99
104
|
def passes_filter?(dir, filter)
|
100
105
|
return true if filter.nil?
|
101
106
|
|
107
|
+
# Would like to reinstate but requires investigation, see RUBY-1749
|
108
|
+
return false if dir == 'rake' and RUBY_VERSION >= '2.1' and RUBY_VERSION < '2.3'
|
109
|
+
|
102
110
|
if filter.include?("group=")
|
103
111
|
key = filter.sub("group=", "")
|
104
112
|
group = GROUPS[key]
|