newrelic_rpm 2.8.11 → 2.9.2
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 +267 -0
- data/LICENSE +1 -1
- data/Manifest +142 -0
- data/README.md +138 -0
- data/Rakefile +10 -28
- data/bin/mongrel_rpm +33 -0
- data/cert/cacert.pem +34 -0
- data/init.rb +38 -0
- data/lib/new_relic/agent/agent.rb +160 -347
- data/lib/new_relic/agent/collection_helper.rb +13 -24
- data/lib/new_relic/agent/error_collector.rb +29 -15
- data/lib/new_relic/agent/instrumentation/active_record_instrumentation.rb +63 -76
- data/lib/new_relic/agent/instrumentation/controller_instrumentation.rb +90 -48
- data/lib/new_relic/agent/instrumentation/dispatcher_instrumentation.rb +72 -47
- data/lib/new_relic/agent/instrumentation/error_instrumentation.rb +14 -0
- data/lib/new_relic/agent/instrumentation/merb/controller.rb +10 -1
- data/lib/new_relic/agent/instrumentation/merb/dispatcher.rb +5 -7
- data/lib/new_relic/agent/instrumentation/merb/errors.rb +3 -1
- data/lib/new_relic/agent/instrumentation/passenger_instrumentation.rb +7 -0
- data/lib/new_relic/agent/instrumentation/rails/action_controller.rb +34 -7
- data/lib/new_relic/agent/instrumentation/rails/dispatcher.rb +20 -12
- data/lib/new_relic/agent/instrumentation/rails/errors.rb +5 -4
- data/lib/new_relic/agent/method_tracer.rb +159 -135
- data/lib/new_relic/agent/patch_const_missing.rb +46 -26
- data/lib/new_relic/agent/sampler.rb +12 -0
- data/lib/new_relic/agent/samplers/cpu_sampler.rb +44 -0
- data/lib/new_relic/agent/samplers/memory_sampler.rb +126 -0
- data/lib/new_relic/agent/samplers/mongrel_sampler.rb +22 -0
- data/lib/new_relic/agent/shim_agent.rb +11 -0
- data/lib/new_relic/agent/stats_engine.rb +85 -46
- data/lib/new_relic/agent/transaction_sampler.rb +63 -38
- data/lib/new_relic/agent/worker_loop.rb +8 -18
- data/lib/new_relic/agent.rb +200 -25
- data/lib/new_relic/commands/deployments.rb +9 -9
- data/lib/new_relic/control/merb.rb +22 -0
- data/lib/new_relic/control/rails.rb +141 -0
- data/lib/new_relic/{config → control}/ruby.rb +13 -2
- data/lib/new_relic/control.rb +424 -0
- data/lib/new_relic/local_environment.rb +201 -79
- data/lib/new_relic/metric_data.rb +7 -0
- data/lib/new_relic/metric_parser/action_mailer.rb +9 -0
- data/lib/new_relic/metric_parser/active_merchant.rb +26 -0
- data/lib/new_relic/metric_parser/active_record.rb +11 -0
- data/lib/new_relic/metric_parser/controller.rb +51 -0
- data/lib/new_relic/metric_parser/controller_cpu.rb +38 -0
- data/lib/new_relic/metric_parser/database.rb +23 -0
- data/lib/new_relic/metric_parser/errors.rb +6 -0
- data/lib/new_relic/metric_parser/mem_cache.rb +12 -0
- data/lib/new_relic/metric_parser/view.rb +61 -0
- data/lib/new_relic/metric_parser/web_service.rb +9 -0
- data/lib/new_relic/metric_parser.rb +107 -0
- data/lib/new_relic/metric_spec.rb +5 -0
- data/lib/new_relic/noticed_error.rb +5 -1
- data/lib/new_relic/rack/metric_app.rb +57 -0
- data/lib/new_relic/rack/newrelic.ru +25 -0
- data/lib/new_relic/rack/newrelic.yml +25 -0
- data/lib/new_relic/rack.rb +5 -0
- data/lib/new_relic/recipes.rb +10 -3
- data/lib/new_relic/stats.rb +130 -144
- data/lib/new_relic/transaction_analysis.rb +7 -8
- data/lib/new_relic/transaction_sample.rb +86 -10
- data/lib/new_relic/version.rb +41 -160
- data/lib/new_relic_api.rb +7 -6
- data/lib/newrelic_rpm.rb +30 -17
- data/lib/tasks/{agent_tests.rake → tests.rake} +1 -1
- data/newrelic.yml +115 -62
- data/newrelic_rpm.gemspec +36 -0
- data/test/active_record_fixtures.rb +55 -0
- data/test/config/newrelic.yml +21 -3
- data/test/config/{test_config.rb → test_control.rb} +14 -10
- data/test/new_relic/agent/active_record_instrumentation_test.rb +189 -0
- data/test/new_relic/agent/agent_test.rb +104 -0
- data/test/new_relic/agent/agent_test_controller.rb +18 -1
- data/test/new_relic/agent/classloader_patch_test.rb +56 -0
- data/test/new_relic/agent/{tc_collection_helper.rb → collection_helper_test.rb} +28 -23
- data/test/new_relic/agent/controller_test.rb +107 -0
- data/test/new_relic/agent/dispatcher_instrumentation_test.rb +70 -0
- data/test/new_relic/agent/error_collector_test.rb +155 -0
- data/test/new_relic/agent/{tc_method_tracer.rb → method_tracer_test.rb} +6 -12
- data/test/new_relic/agent/metric_data_test.rb +56 -0
- data/test/new_relic/agent/stats_engine_test.rb +266 -0
- data/test/new_relic/agent/{tc_transaction_sample_builder.rb → transaction_sample_builder_test.rb} +6 -5
- data/test/new_relic/agent/{tc_transaction_sample.rb → transaction_sample_test.rb} +9 -13
- data/test/new_relic/agent/transaction_sampler_test.rb +317 -0
- data/test/new_relic/agent/{tc_worker_loop.rb → worker_loop_test.rb} +1 -1
- data/test/new_relic/control_test.rb +97 -0
- data/test/new_relic/{tc_deployments_api.rb → deployments_api_test.rb} +8 -4
- data/test/new_relic/environment_test.rb +75 -0
- data/test/new_relic/metric_parser_test.rb +142 -0
- data/test/new_relic/{tc_metric_spec.rb → metric_spec_test.rb} +28 -1
- data/test/new_relic/samplers_test.rb +71 -0
- data/test/new_relic/{tc_shim_agent.rb → shim_agent_test.rb} +1 -1
- data/test/new_relic/stats_test.rb +291 -0
- data/test/new_relic/version_number_test.rb +46 -0
- data/test/test_helper.rb +7 -30
- data/test/ui/newrelic_controller_test.rb +14 -0
- data/test/ui/{tc_newrelic_helper.rb → newrelic_helper_test.rb} +16 -7
- data/ui/controllers/newrelic_controller.rb +17 -3
- data/ui/helpers/newrelic_helper.rb +44 -15
- data/ui/views/layouts/newrelic_default.rhtml +7 -8
- data/ui/views/newrelic/_sample.rhtml +5 -2
- data/ui/views/newrelic/_segment.rhtml +1 -1
- data/ui/views/newrelic/_segment_limit_message.rhtml +1 -0
- data/ui/views/newrelic/_segment_row.rhtml +4 -4
- data/ui/views/newrelic/_show_sample_detail.rhtml +3 -1
- data/ui/views/newrelic/_show_sample_sql.rhtml +2 -1
- data/ui/views/newrelic/explain_sql.rhtml +2 -5
- data/ui/views/newrelic/images/file_icon.png +0 -0
- data/ui/views/newrelic/images/new_relic_rpm_desktop.gif +0 -0
- data/ui/views/newrelic/index.rhtml +21 -13
- data/ui/views/newrelic/javascript/prototype-scriptaculous.js +7288 -0
- data/ui/views/newrelic/show_sample.rhtml +18 -3
- data/ui/views/newrelic/stylesheets/style.css +39 -0
- data/ui/views/newrelic/threads.rhtml +52 -0
- metadata +192 -70
- data/README +0 -136
- data/lib/new_relic/agent/instrumentation/rails/rails.rb +0 -6
- data/lib/new_relic/agent/samplers/cpu.rb +0 -29
- data/lib/new_relic/agent/samplers/memory.rb +0 -53
- data/lib/new_relic/agent/samplers/mongrel.rb +0 -26
- data/lib/new_relic/agent/synchronize.rb +0 -40
- data/lib/new_relic/config/merb.rb +0 -35
- data/lib/new_relic/config/rails.rb +0 -114
- data/lib/new_relic/config.rb +0 -279
- data/lib/new_relic/shim_agent.rb +0 -96
- data/test/new_relic/agent/model_fixture.rb +0 -15
- data/test/new_relic/agent/tc_active_record.rb +0 -90
- data/test/new_relic/agent/tc_agent.rb +0 -148
- data/test/new_relic/agent/tc_controller.rb +0 -77
- data/test/new_relic/agent/tc_dispatcher_instrumentation.rb +0 -52
- data/test/new_relic/agent/tc_error_collector.rb +0 -127
- data/test/new_relic/agent/tc_stats_engine.rb +0 -218
- data/test/new_relic/agent/tc_synchronize.rb +0 -37
- data/test/new_relic/agent/tc_transaction_sampler.rb +0 -302
- data/test/new_relic/tc_config.rb +0 -36
- data/test/new_relic/tc_environment.rb +0 -94
- data/test/new_relic/tc_stats.rb +0 -141
data/lib/newrelic_rpm.rb
CHANGED
@@ -1,27 +1,40 @@
|
|
1
|
-
#
|
2
|
-
#
|
1
|
+
# == New Relic Initialization
|
2
|
+
#
|
3
|
+
# When installed as a gem, you can activate the New Relic agent one of the following ways:
|
4
|
+
#
|
5
|
+
# For Rails, add:
|
3
6
|
# config.gem 'newrelic_rpm'
|
4
7
|
# to your initialization sequence.
|
5
8
|
#
|
6
|
-
|
9
|
+
# For merb, do
|
10
|
+
# dependency 'newrelic_rpm'
|
11
|
+
# in the Merb config/init.rb
|
12
|
+
#
|
13
|
+
# For other frameworks, or to manage the agent manually, invoke NewRelic::Agent#manual_start
|
14
|
+
# directly.
|
15
|
+
#
|
16
|
+
require 'new_relic/control'
|
7
17
|
|
8
18
|
def log!(message)
|
9
19
|
STDERR.puts "[NewRelic] #{message}"
|
10
20
|
end
|
11
21
|
|
12
|
-
#
|
13
|
-
# We
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
else
|
18
|
-
# After verison 2.0 of Rails we can access the configuration directly.
|
19
|
-
# We need it to add dev mode routes after initialization finished.
|
20
|
-
if defined? Rails.configuration
|
21
|
-
Rails.configuration.after_initialize do
|
22
|
-
NewRelic::Config.instance.start_plugin Rails.configuration
|
23
|
-
end
|
24
|
-
else
|
25
|
-
NewRelic::Config.instance.start_plugin
|
22
|
+
# After verison 2.0 of Rails we can access the configuration directly.
|
23
|
+
# We need it to add dev mode routes after initialization finished.
|
24
|
+
if defined? Rails.configuration
|
25
|
+
Rails.configuration.after_initialize do
|
26
|
+
NewRelic::Control.instance.init_plugin :config => Rails.configuration
|
26
27
|
end
|
28
|
+
elsif defined? Merb
|
29
|
+
module NewRelic
|
30
|
+
class MerbBootLoader < Merb::BootLoader
|
31
|
+
after Merb::BootLoader::ChooseAdapter
|
32
|
+
|
33
|
+
def self.run
|
34
|
+
NewRelic::Control.instance.init_plugin
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
else
|
39
|
+
NewRelic::Control.instance.init_plugin
|
27
40
|
end
|
@@ -5,7 +5,7 @@ if defined? Rake::TestTask
|
|
5
5
|
Rake::TestTask.new(:newrelic) do |t|
|
6
6
|
t.libs << "#{AGENT_HOME}/test"
|
7
7
|
t.libs << "#{AGENT_HOME}/lib"
|
8
|
-
t.pattern = "#{AGENT_HOME}/test
|
8
|
+
t.pattern = "#{AGENT_HOME}/test/**/*_test.rb"
|
9
9
|
t.verbose = true
|
10
10
|
end
|
11
11
|
Rake::Task['test:newrelic'].comment = "Run the unit tests for the Agent"
|
data/newrelic.yml
CHANGED
@@ -1,101 +1,153 @@
|
|
1
1
|
#
|
2
|
-
# This file configures the NewRelic RPM Agent, NewRelic RPM monitors
|
3
|
-
# applications with deep visibility and low overhead. For more
|
4
|
-
# visit www.newrelic.com.
|
2
|
+
# This file configures the NewRelic RPM Agent, NewRelic RPM monitors
|
3
|
+
# Rails applications with deep visibility and low overhead. For more
|
4
|
+
# information, visit www.newrelic.com.
|
5
5
|
#
|
6
6
|
# <%= generated_for_user %>
|
7
7
|
#
|
8
8
|
# here are the settings that are common to all environments
|
9
9
|
common: &default_settings
|
10
10
|
# ============================== LICENSE KEY ===============================
|
11
|
-
|
12
|
-
#
|
11
|
+
|
12
|
+
# You must specify the licence key associated with your New Relic
|
13
|
+
# account. This key binds your Agent's data to your account in the
|
14
|
+
# New Relic RPM service.
|
13
15
|
license_key: '<%= license_key %>'
|
14
16
|
|
17
|
+
# Agent Enabled
|
18
|
+
# Use this setting to force the agent to run or not run.
|
19
|
+
# Default is 'auto' which means the agent will install and run only
|
20
|
+
# if a valid dispatcher such as Mongrel is running. This prevents
|
21
|
+
# it from running with Rake or the console. Set to false to
|
22
|
+
# completely turn the agent off regardless of the other settings.
|
23
|
+
# Valid values are true, false and auto.
|
24
|
+
# agent_enabled: auto
|
25
|
+
|
15
26
|
# Application Name
|
16
|
-
# Set this to be the name of your application as you'd like it show
|
17
|
-
# RPM will then auto-map instances of your application
|
18
|
-
# on your home dashboard page.
|
27
|
+
# Set this to be the name of your application as you'd like it show
|
28
|
+
# up in RPM. RPM will then auto-map instances of your application
|
29
|
+
# into a RPM "application" on your home dashboard page. If you want
|
30
|
+
# to map this instance into multiple apps, like "AJAX Requests" and
|
31
|
+
# "All UI" then specify a semicolon separated list of up to three
|
32
|
+
# distinct names. This setting does not prevent you from manually
|
19
33
|
# defining applications.
|
20
34
|
app_name: My Application
|
21
35
|
|
22
|
-
#
|
23
|
-
#
|
24
|
-
#
|
25
|
-
#
|
26
|
-
# when turned on, the agent collects performance data by inserting lightweight
|
27
|
-
# tracers on key methods inside the rails framework and asynchronously aggregating
|
28
|
-
# and reporting this performance data to the NewRelic RPM service at NewRelic.com.
|
29
|
-
# below.
|
36
|
+
# When 'enabled' is turned on, the agent collects performance data
|
37
|
+
# by inserting lightweight tracers on key methods inside the rails
|
38
|
+
# framework and asynchronously aggregating and reporting this
|
39
|
+
# performance data to the NewRelic RPM service at newrelic.com.
|
30
40
|
enabled: false
|
31
41
|
|
32
|
-
# The newrelic agent generates its own log file to keep its logging
|
33
|
-
# separate from that of your application. Specify its
|
42
|
+
# The newrelic agent generates its own log file to keep its logging
|
43
|
+
# information separate from that of your application. Specify its
|
44
|
+
# log level here.
|
34
45
|
log_level: info
|
35
46
|
|
36
|
-
# The newrelic agent communicates with the RPM service via http by
|
37
|
-
# If you want to communicate via https to increase
|
38
|
-
# SSL by setting this value to true. Note,
|
39
|
-
# CPU overhead to perform the
|
40
|
-
#
|
41
|
-
#
|
47
|
+
# The newrelic agent communicates with the RPM service via http by
|
48
|
+
# default. If you want to communicate via https to increase
|
49
|
+
# security, then turn on SSL by setting this value to true. Note,
|
50
|
+
# this will result in increased CPU overhead to perform the
|
51
|
+
# encryption involved in SSL communication, but this work is done
|
52
|
+
# asynchronously to the threads that process your application code,
|
53
|
+
# so it should not impact response times.
|
42
54
|
ssl: false
|
55
|
+
|
56
|
+
# EXPERIMENTAL: enable verification of the SSL certificate sent by
|
57
|
+
# the server. This setting has no effect unless SSL is enabled
|
58
|
+
# above. This may block your application. Only enable it if the data
|
59
|
+
# you send us needs end-to-end verified certificates.
|
60
|
+
#
|
61
|
+
# This means we cannot cache the DNS lookup, so each request to the
|
62
|
+
# RPM service will perform a lookup. It also means that we cannot
|
63
|
+
# use a non-blocking lookup, so in a worst case, if you have DNS
|
64
|
+
# problems, your app may block indefinitely.
|
65
|
+
# verify_certificate: true
|
43
66
|
|
67
|
+
# Set your application's Apdex threshold value with the 'apdex_t'
|
68
|
+
# setting, in seconds. The apdex_t value determines the buckets used
|
69
|
+
# to compute your overall Apdex score.
|
70
|
+
# Requests that take less than apdex_t seconds to process will be
|
71
|
+
# classified as Satisfying transactions; more than apdex_t seconds
|
72
|
+
# as Tolerating transactions; and more than four times the apdex_t
|
73
|
+
# value as Frustrating transactions.
|
74
|
+
# For more about the Apdex standard, see
|
75
|
+
# http://support.newrelic.com/faqs/general/apdex
|
76
|
+
|
77
|
+
apdex_t: 0.5
|
78
|
+
|
44
79
|
|
45
80
|
# Proxy settings for connecting to the RPM server.
|
46
81
|
#
|
47
|
-
# If a proxy is used, the host setting is required. Other settings
|
48
|
-
# port is 8080.
|
82
|
+
# If a proxy is used, the host setting is required. Other settings
|
83
|
+
# are optional. Default port is 8080.
|
49
84
|
#
|
50
|
-
# proxy_host:
|
85
|
+
# proxy_host: hostname
|
51
86
|
# proxy_port: 8080
|
52
87
|
# proxy_user:
|
53
88
|
# proxy_pass:
|
54
89
|
|
55
90
|
|
56
|
-
# Tells transaction tracer and error collector (when enabled)
|
57
|
-
#
|
91
|
+
# Tells transaction tracer and error collector (when enabled)
|
92
|
+
# whether or not to capture HTTP params. When true, the RoR
|
93
|
+
# filter_parameter_logging mechanism is used so that sensitive
|
94
|
+
# parameters are not recorded
|
58
95
|
capture_params: false
|
59
96
|
|
60
97
|
|
61
98
|
# Transaction tracer captures deep information about slow
|
62
|
-
# transactions and sends this to the RPM service once a
|
63
|
-
# transaction is the exact call sequence of
|
64
|
-
# issued.
|
99
|
+
# transactions and sends this to the RPM service once a
|
100
|
+
# minute. Included in the transaction is the exact call sequence of
|
101
|
+
# the transactions including any SQL statements issued.
|
65
102
|
transaction_tracer:
|
66
103
|
|
67
|
-
# Transaction tracer is enabled by default. Set this to false to
|
68
|
-
# is only available at the Silver and
|
104
|
+
# Transaction tracer is enabled by default. Set this to false to
|
105
|
+
# turn it off. This feature is only available at the Silver and
|
106
|
+
# above product levels.
|
69
107
|
enabled: true
|
70
|
-
|
108
|
+
|
109
|
+
# Threshold in seconds for when to collect a transaction
|
110
|
+
# trace. When the response time of a controller action exceeds
|
111
|
+
# this threshold, a transaction trace will be recorded and sent to
|
112
|
+
# RPM. Valid values are any float value, or (default) "apdex_f",
|
113
|
+
# which will use the threshold for an dissatisfying Apdex
|
114
|
+
# controller action - four times the Apdex T value.
|
115
|
+
transaction_threshold: apdex_f
|
71
116
|
|
72
|
-
# When transaction tracer is on, SQL statements can optionally be
|
73
|
-
# has three modes, "off" which sends no
|
74
|
-
#
|
117
|
+
# When transaction tracer is on, SQL statements can optionally be
|
118
|
+
# recorded. The recorder has three modes, "off" which sends no
|
119
|
+
# SQL, "raw" which sends the SQL statement in its original form,
|
120
|
+
# and "obfuscated", which strips out numeric and string literals
|
75
121
|
record_sql: obfuscated
|
76
122
|
|
77
|
-
# Threshold in seconds for when to collect stack trace for a SQL
|
78
|
-
# when SQL statements exceed this threshold,
|
79
|
-
#
|
123
|
+
# Threshold in seconds for when to collect stack trace for a SQL
|
124
|
+
# call. In other words, when SQL statements exceed this threshold,
|
125
|
+
# then capture and send to RPM the current stack trace. This is
|
126
|
+
# helpful for pinpointing where long SQL calls originate from
|
80
127
|
stack_trace_threshold: 0.500
|
81
128
|
|
82
|
-
# Error collector captures information about uncaught exceptions and
|
83
|
-
# viewing
|
129
|
+
# Error collector captures information about uncaught exceptions and
|
130
|
+
# sends them to RPM for viewing
|
84
131
|
error_collector:
|
85
132
|
|
86
|
-
# Error collector is enabled by default. Set this to false to turn
|
87
|
-
# is only available at the Silver and above
|
133
|
+
# Error collector is enabled by default. Set this to false to turn
|
134
|
+
# it off. This feature is only available at the Silver and above
|
135
|
+
# product levels
|
88
136
|
enabled: true
|
89
137
|
|
90
|
-
# Tells error collector whether or not to capture a source snippet
|
91
|
-
# error when errors are View related.
|
138
|
+
# Tells error collector whether or not to capture a source snippet
|
139
|
+
# around the place of the error when errors are View related.
|
92
140
|
capture_source: true
|
93
141
|
|
94
|
-
# To stop specific errors from reporting to RPM, set this property
|
95
|
-
# values
|
142
|
+
# To stop specific errors from reporting to RPM, set this property
|
143
|
+
# to comma separated values
|
96
144
|
#
|
97
145
|
#ignore_errors: ActionController::RoutingError, ...
|
98
146
|
|
147
|
+
# (Advanced) Uncomment this to ensure the cpu and memory samplers
|
148
|
+
# won't run. Useful when you are using the agent to monitor an
|
149
|
+
# external resource
|
150
|
+
# disable_samplers: true
|
99
151
|
|
100
152
|
# override default settings based on your application's environment
|
101
153
|
|
@@ -104,33 +156,34 @@ common: &default_settings
|
|
104
156
|
|
105
157
|
development:
|
106
158
|
<<: *default_settings
|
107
|
-
# turn off communication to RPM service in development mode.
|
108
|
-
#
|
159
|
+
# turn off communication to RPM service in development mode. NOTE:
|
160
|
+
# for initial evaluation purposes, you may want to temporarily turn
|
109
161
|
# the agent on in development mode.
|
110
162
|
enabled: false
|
111
163
|
|
112
|
-
# When running in Developer Mode, the New Relic Agent will present
|
113
|
-
# performance information on the last 100 transactions you have
|
114
|
-
# executed since starting the mongrel. to view this data, go to
|
164
|
+
# When running in Developer Mode, the New Relic Agent will present
|
165
|
+
# performance information on the last 100 transactions you have
|
166
|
+
# executed since starting the mongrel. to view this data, go to
|
115
167
|
# http://localhost:3000/newrelic
|
116
168
|
developer: true
|
117
169
|
|
118
170
|
test:
|
119
171
|
<<: *default_settings
|
120
|
-
# it almost never makes sense to turn on the agent when running
|
121
|
-
# integration tests or the like.
|
172
|
+
# it almost never makes sense to turn on the agent when running
|
173
|
+
# unit, functional or integration tests or the like.
|
122
174
|
enabled: false
|
123
175
|
|
124
|
-
# Turn on the agent in production for 24x7 monitoring. NewRelic
|
125
|
-
# an average performance impact of < 5 ms per
|
126
|
-
#
|
176
|
+
# Turn on the agent in production for 24x7 monitoring. NewRelic
|
177
|
+
# testing shows an average performance impact of < 5 ms per
|
178
|
+
# transaction, you you can leave this on all the time without
|
179
|
+
# incurring any user-visible performance degredation.
|
127
180
|
production:
|
128
181
|
<<: *default_settings
|
129
182
|
enabled: true
|
130
183
|
|
131
|
-
# many applications have a staging environment which behaves
|
132
|
-
# Support for that environment is provided
|
133
|
-
# the agent turned on.
|
184
|
+
# many applications have a staging environment which behaves
|
185
|
+
# identically to production. Support for that environment is provided
|
186
|
+
# here. By default, the staging environment has the agent turned on.
|
134
187
|
staging:
|
135
188
|
<<: *default_settings
|
136
189
|
enabled: true
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = %q{newrelic_rpm}
|
5
|
+
s.version = "2.9.2"
|
6
|
+
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
|
+
s.authors = ["Bill Kayser"]
|
9
|
+
s.date = %q{2009-06-23}
|
10
|
+
s.description = %q{New Relic Ruby Performance Monitoring Agent}
|
11
|
+
s.email = %q{bkayser@newrelic.com}
|
12
|
+
s.executables = ["mongrel_rpm", "newrelic_cmd"]
|
13
|
+
s.extra_rdoc_files = ["bin/mongrel_rpm", "bin/newrelic_cmd", "CHANGELOG", "lib/new_relic/agent/agent.rb", "lib/new_relic/agent/chained_call.rb", "lib/new_relic/agent/collection_helper.rb", "lib/new_relic/agent/error_collector.rb", "lib/new_relic/agent/instrumentation/active_merchant.rb", "lib/new_relic/agent/instrumentation/active_record_instrumentation.rb", "lib/new_relic/agent/instrumentation/controller_instrumentation.rb", "lib/new_relic/agent/instrumentation/data_mapper.rb", "lib/new_relic/agent/instrumentation/dispatcher_instrumentation.rb", "lib/new_relic/agent/instrumentation/error_instrumentation.rb", "lib/new_relic/agent/instrumentation/memcache.rb", "lib/new_relic/agent/instrumentation/merb/controller.rb", "lib/new_relic/agent/instrumentation/merb/dispatcher.rb", "lib/new_relic/agent/instrumentation/merb/errors.rb", "lib/new_relic/agent/instrumentation/passenger_instrumentation.rb", "lib/new_relic/agent/instrumentation/rails/action_controller.rb", "lib/new_relic/agent/instrumentation/rails/action_web_service.rb", "lib/new_relic/agent/instrumentation/rails/dispatcher.rb", "lib/new_relic/agent/instrumentation/rails/errors.rb", "lib/new_relic/agent/method_tracer.rb", "lib/new_relic/agent/patch_const_missing.rb", "lib/new_relic/agent/sampler.rb", "lib/new_relic/agent/samplers/cpu_sampler.rb", "lib/new_relic/agent/samplers/memory_sampler.rb", "lib/new_relic/agent/samplers/mongrel_sampler.rb", "lib/new_relic/agent/shim_agent.rb", "lib/new_relic/agent/stats_engine.rb", "lib/new_relic/agent/transaction_sampler.rb", "lib/new_relic/agent/worker_loop.rb", "lib/new_relic/agent.rb", "lib/new_relic/commands/deployments.rb", "lib/new_relic/commands/new_relic_commands.rb", "lib/new_relic/control/merb.rb", "lib/new_relic/control/rails.rb", "lib/new_relic/control/ruby.rb", "lib/new_relic/control.rb", "lib/new_relic/local_environment.rb", "lib/new_relic/merbtasks.rb", "lib/new_relic/metric_data.rb", "lib/new_relic/metric_parser/action_mailer.rb", "lib/new_relic/metric_parser/active_merchant.rb", "lib/new_relic/metric_parser/active_record.rb", "lib/new_relic/metric_parser/controller.rb", "lib/new_relic/metric_parser/controller_cpu.rb", "lib/new_relic/metric_parser/database.rb", "lib/new_relic/metric_parser/errors.rb", "lib/new_relic/metric_parser/mem_cache.rb", "lib/new_relic/metric_parser/view.rb", "lib/new_relic/metric_parser/web_service.rb", "lib/new_relic/metric_parser.rb", "lib/new_relic/metric_spec.rb", "lib/new_relic/metrics.rb", "lib/new_relic/noticed_error.rb", "lib/new_relic/rack/metric_app.rb", "lib/new_relic/rack/newrelic.ru", "lib/new_relic/rack/newrelic.yml", "lib/new_relic/rack.rb", "lib/new_relic/recipes.rb", "lib/new_relic/stats.rb", "lib/new_relic/transaction_analysis.rb", "lib/new_relic/transaction_sample.rb", "lib/new_relic/version.rb", "lib/new_relic_api.rb", "lib/newrelic_rpm.rb", "lib/tasks/all.rb", "lib/tasks/install.rake", "lib/tasks/tests.rake", "LICENSE", "README.md"]
|
14
|
+
s.files = ["bin/mongrel_rpm", "bin/newrelic_cmd", "cert/cacert.pem", "CHANGELOG", "init.rb", "install.rb", "lib/new_relic/agent/agent.rb", "lib/new_relic/agent/chained_call.rb", "lib/new_relic/agent/collection_helper.rb", "lib/new_relic/agent/error_collector.rb", "lib/new_relic/agent/instrumentation/active_merchant.rb", "lib/new_relic/agent/instrumentation/active_record_instrumentation.rb", "lib/new_relic/agent/instrumentation/controller_instrumentation.rb", "lib/new_relic/agent/instrumentation/data_mapper.rb", "lib/new_relic/agent/instrumentation/dispatcher_instrumentation.rb", "lib/new_relic/agent/instrumentation/error_instrumentation.rb", "lib/new_relic/agent/instrumentation/memcache.rb", "lib/new_relic/agent/instrumentation/merb/controller.rb", "lib/new_relic/agent/instrumentation/merb/dispatcher.rb", "lib/new_relic/agent/instrumentation/merb/errors.rb", "lib/new_relic/agent/instrumentation/passenger_instrumentation.rb", "lib/new_relic/agent/instrumentation/rails/action_controller.rb", "lib/new_relic/agent/instrumentation/rails/action_web_service.rb", "lib/new_relic/agent/instrumentation/rails/dispatcher.rb", "lib/new_relic/agent/instrumentation/rails/errors.rb", "lib/new_relic/agent/method_tracer.rb", "lib/new_relic/agent/patch_const_missing.rb", "lib/new_relic/agent/sampler.rb", "lib/new_relic/agent/samplers/cpu_sampler.rb", "lib/new_relic/agent/samplers/memory_sampler.rb", "lib/new_relic/agent/samplers/mongrel_sampler.rb", "lib/new_relic/agent/shim_agent.rb", "lib/new_relic/agent/stats_engine.rb", "lib/new_relic/agent/transaction_sampler.rb", "lib/new_relic/agent/worker_loop.rb", "lib/new_relic/agent.rb", "lib/new_relic/commands/deployments.rb", "lib/new_relic/commands/new_relic_commands.rb", "lib/new_relic/control/merb.rb", "lib/new_relic/control/rails.rb", "lib/new_relic/control/ruby.rb", "lib/new_relic/control.rb", "lib/new_relic/local_environment.rb", "lib/new_relic/merbtasks.rb", "lib/new_relic/metric_data.rb", "lib/new_relic/metric_parser/action_mailer.rb", "lib/new_relic/metric_parser/active_merchant.rb", "lib/new_relic/metric_parser/active_record.rb", "lib/new_relic/metric_parser/controller.rb", "lib/new_relic/metric_parser/controller_cpu.rb", "lib/new_relic/metric_parser/database.rb", "lib/new_relic/metric_parser/errors.rb", "lib/new_relic/metric_parser/mem_cache.rb", "lib/new_relic/metric_parser/view.rb", "lib/new_relic/metric_parser/web_service.rb", "lib/new_relic/metric_parser.rb", "lib/new_relic/metric_spec.rb", "lib/new_relic/metrics.rb", "lib/new_relic/noticed_error.rb", "lib/new_relic/rack/metric_app.rb", "lib/new_relic/rack/newrelic.ru", "lib/new_relic/rack/newrelic.yml", "lib/new_relic/rack.rb", "lib/new_relic/recipes.rb", "lib/new_relic/stats.rb", "lib/new_relic/transaction_analysis.rb", "lib/new_relic/transaction_sample.rb", "lib/new_relic/version.rb", "lib/new_relic_api.rb", "lib/newrelic_rpm.rb", "lib/tasks/all.rb", "lib/tasks/install.rake", "lib/tasks/tests.rake", "LICENSE", "Manifest", "newrelic.yml", "Rakefile", "README.md", "recipes/newrelic.rb", "test/active_record_fixtures.rb", "test/config/newrelic.yml", "test/config/test_control.rb", "test/new_relic/agent/active_record_instrumentation_test.rb", "test/new_relic/agent/agent_test.rb", "test/new_relic/agent/agent_test_controller.rb", "test/new_relic/agent/classloader_patch_test.rb", "test/new_relic/agent/collection_helper_test.rb", "test/new_relic/agent/controller_test.rb", "test/new_relic/agent/dispatcher_instrumentation_test.rb", "test/new_relic/agent/error_collector_test.rb", "test/new_relic/agent/method_tracer_test.rb", "test/new_relic/agent/metric_data_test.rb", "test/new_relic/agent/mock_ar_connection.rb", "test/new_relic/agent/mock_scope_listener.rb", "test/new_relic/agent/stats_engine_test.rb", "test/new_relic/agent/testable_agent.rb", "test/new_relic/agent/transaction_sample_builder_test.rb", "test/new_relic/agent/transaction_sample_test.rb", "test/new_relic/agent/transaction_sampler_test.rb", "test/new_relic/agent/worker_loop_test.rb", "test/new_relic/control_test.rb", "test/new_relic/deployments_api_test.rb", "test/new_relic/environment_test.rb", "test/new_relic/metric_parser_test.rb", "test/new_relic/metric_spec_test.rb", "test/new_relic/samplers_test.rb", "test/new_relic/shim_agent_test.rb", "test/new_relic/stats_test.rb", "test/new_relic/version_number_test.rb", "test/test_helper.rb", "test/ui/newrelic_controller_test.rb", "test/ui/newrelic_helper_test.rb", "ui/controllers/newrelic_controller.rb", "ui/helpers/google_pie_chart.rb", "ui/helpers/newrelic_helper.rb", "ui/views/layouts/newrelic_default.rhtml", "ui/views/newrelic/_explain_plans.rhtml", "ui/views/newrelic/_sample.rhtml", "ui/views/newrelic/_segment.rhtml", "ui/views/newrelic/_segment_limit_message.rhtml", "ui/views/newrelic/_segment_row.rhtml", "ui/views/newrelic/_show_sample_detail.rhtml", "ui/views/newrelic/_show_sample_sql.rhtml", "ui/views/newrelic/_show_sample_summary.rhtml", "ui/views/newrelic/_sql_row.rhtml", "ui/views/newrelic/_stack_trace.rhtml", "ui/views/newrelic/_table.rhtml", "ui/views/newrelic/explain_sql.rhtml", "ui/views/newrelic/images/arrow-close.png", "ui/views/newrelic/images/arrow-open.png", "ui/views/newrelic/images/blue_bar.gif", "ui/views/newrelic/images/file_icon.png", "ui/views/newrelic/images/gray_bar.gif", "ui/views/newrelic/images/new_relic_rpm_desktop.gif", "ui/views/newrelic/index.rhtml", "ui/views/newrelic/javascript/prototype-scriptaculous.js", "ui/views/newrelic/javascript/transaction_sample.js", "ui/views/newrelic/sample_not_found.rhtml", "ui/views/newrelic/show_sample.rhtml", "ui/views/newrelic/show_source.rhtml", "ui/views/newrelic/stylesheets/style.css", "ui/views/newrelic/threads.rhtml", "newrelic_rpm.gemspec"]
|
15
|
+
s.has_rdoc = true
|
16
|
+
s.homepage = %q{http://www.newrelic.com}
|
17
|
+
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Newrelic_rpm", "--main", "README.md"]
|
18
|
+
s.require_paths = ["lib"]
|
19
|
+
s.rubyforge_project = %q{newrelic}
|
20
|
+
s.rubygems_version = %q{1.3.1}
|
21
|
+
s.summary = %q{New Relic Ruby Performance Monitoring Agent}
|
22
|
+
s.test_files = ["test/config/test_control.rb", "test/new_relic/agent/active_record_instrumentation_test.rb", "test/new_relic/agent/agent_test.rb", "test/new_relic/agent/classloader_patch_test.rb", "test/new_relic/agent/collection_helper_test.rb", "test/new_relic/agent/controller_test.rb", "test/new_relic/agent/dispatcher_instrumentation_test.rb", "test/new_relic/agent/error_collector_test.rb", "test/new_relic/agent/method_tracer_test.rb", "test/new_relic/agent/metric_data_test.rb", "test/new_relic/agent/stats_engine_test.rb", "test/new_relic/agent/transaction_sample_builder_test.rb", "test/new_relic/agent/transaction_sample_test.rb", "test/new_relic/agent/transaction_sampler_test.rb", "test/new_relic/agent/worker_loop_test.rb", "test/new_relic/control_test.rb", "test/new_relic/deployments_api_test.rb", "test/new_relic/environment_test.rb", "test/new_relic/metric_parser_test.rb", "test/new_relic/metric_spec_test.rb", "test/new_relic/samplers_test.rb", "test/new_relic/shim_agent_test.rb", "test/new_relic/stats_test.rb", "test/new_relic/version_number_test.rb", "test/test_helper.rb", "test/ui/newrelic_controller_test.rb", "test/ui/newrelic_helper_test.rb"]
|
23
|
+
|
24
|
+
if s.respond_to? :specification_version then
|
25
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
26
|
+
s.specification_version = 2
|
27
|
+
|
28
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
29
|
+
s.add_development_dependency(%q<echoe>, [">= 0"])
|
30
|
+
else
|
31
|
+
s.add_dependency(%q<echoe>, [">= 0"])
|
32
|
+
end
|
33
|
+
else
|
34
|
+
s.add_dependency(%q<echoe>, [">= 0"])
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
# Some test models
|
2
|
+
# These will get created and dropped during the active record tests
|
3
|
+
# Be sure and call setup and teardown
|
4
|
+
module ActiveRecordFixtures
|
5
|
+
extend self
|
6
|
+
def setup
|
7
|
+
ActiveRecordFixtures::Order.setup
|
8
|
+
ActiveRecordFixtures::Shipment.setup
|
9
|
+
end
|
10
|
+
def teardown
|
11
|
+
ActiveRecordFixtures::Shipment.teardown
|
12
|
+
ActiveRecordFixtures::Order.teardown
|
13
|
+
end
|
14
|
+
class Order < ActiveRecord::Base
|
15
|
+
self.table_name = 'newrelic_test_orders'
|
16
|
+
has_and_belongs_to_many :shipments, :class_name => 'ActiveRecordFixtures::Shipment'
|
17
|
+
def self.setup
|
18
|
+
connection.create_table self.table_name, :force => true do |t|
|
19
|
+
t.column :name, :string
|
20
|
+
end
|
21
|
+
end
|
22
|
+
def self.add_delay
|
23
|
+
# Introduce a 500 ms delay into db operations on Orders
|
24
|
+
def connection.log_info *args
|
25
|
+
sleep 0.5
|
26
|
+
super *args
|
27
|
+
end
|
28
|
+
end
|
29
|
+
def self.teardown
|
30
|
+
connection.drop_table table_name
|
31
|
+
def connection.log_info *args
|
32
|
+
super *args
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
class Shipment < ActiveRecord::Base
|
38
|
+
self.table_name = 'newrelic_test_shipment'
|
39
|
+
has_and_belongs_to_many :orders, :class_name => 'ActiveRecordFixtures::Order'
|
40
|
+
def self.setup
|
41
|
+
connection.create_table self.table_name, :force => true do |t|
|
42
|
+
t.column :order_id, :integer
|
43
|
+
end
|
44
|
+
connection.create_table 'orders_shipments', :force => true do |t|
|
45
|
+
t.column :order_id, :integer
|
46
|
+
t.column :shipment_id, :integer
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
def self.teardown
|
51
|
+
connection.drop_table 'orders_shipments'
|
52
|
+
connection.drop_table self.table_name
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
data/test/config/newrelic.yml
CHANGED
@@ -1,7 +1,11 @@
|
|
1
1
|
# This is the config file loaded when running unit tests locally.
|
2
|
+
common: &default_settings
|
3
|
+
transaction_tracer:
|
4
|
+
enabled: true
|
5
|
+
record_sql: raw
|
2
6
|
|
3
7
|
test:
|
4
|
-
|
8
|
+
<<: *default_settings
|
5
9
|
host: localhost
|
6
10
|
port: 3000
|
7
11
|
log_level: debug
|
@@ -9,14 +13,28 @@ test:
|
|
9
13
|
enabled: false
|
10
14
|
developer: true
|
11
15
|
monitor_daemons: false
|
16
|
+
disable_samplers: true
|
12
17
|
api_host: 127.0.0.1
|
13
18
|
api_port: 443
|
14
19
|
message: '<%= generated_for_user %>'
|
15
20
|
license_key: '<%= license_key %>'
|
21
|
+
agent_enabled: auto
|
22
|
+
apdex_t: 1.1
|
23
|
+
|
24
|
+
# Some fixtures for newrelic.yml parsing tests
|
25
|
+
erb_value: <%= 'hey'*3 %>
|
26
|
+
tval: true
|
27
|
+
tstring: 'true'
|
28
|
+
fval: false
|
29
|
+
yval: yes
|
30
|
+
sval: sure
|
31
|
+
|
32
|
+
# checks for loading classes on the background thread
|
33
|
+
check_bg_loading: true
|
34
|
+
|
16
35
|
transaction_tracer:
|
17
|
-
enabled: true
|
18
36
|
record_sql: raw
|
19
|
-
transaction_threshold:
|
37
|
+
transaction_threshold: Apdex_f # case insensitive
|
20
38
|
explain_threshold: 0.1
|
21
39
|
explain_enabled: true
|
22
40
|
stack_trace_threshold: 0.1
|