newrelic_rpm 2.13.5.beta4 → 2.13.6.beta1
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 +8 -0
- data/cert/cacert.pem +21 -0
- data/lib/conditional_vendored_dependency_detection.rb +3 -0
- data/lib/new_relic/agent/agent.rb +14 -1
- data/lib/new_relic/agent/instrumentation/active_merchant.rb +15 -12
- data/lib/new_relic/agent/instrumentation/acts_as_solr.rb +38 -21
- data/lib/new_relic/agent/instrumentation/authlogic.rb +9 -4
- data/lib/new_relic/agent/instrumentation/controller_instrumentation.rb +364 -364
- data/lib/new_relic/agent/instrumentation/data_mapper.rb +142 -121
- data/lib/new_relic/agent/instrumentation/delayed_job_instrumentation.rb +17 -16
- data/lib/new_relic/agent/instrumentation/memcache.rb +40 -26
- data/lib/new_relic/agent/instrumentation/net.rb +19 -13
- data/lib/new_relic/agent/instrumentation/passenger_instrumentation.rb +27 -15
- data/lib/new_relic/agent/instrumentation/rails/active_record_instrumentation.rb +80 -71
- data/lib/new_relic/agent/instrumentation/rails3/active_record_instrumentation.rb +84 -72
- data/lib/new_relic/agent/instrumentation/sequel.rb +84 -70
- data/lib/new_relic/agent/instrumentation/sinatra.rb +44 -37
- data/lib/new_relic/agent/instrumentation/sunspot.rb +18 -12
- data/lib/new_relic/agent/instrumentation/unicorn_instrumentation.rb +13 -7
- data/lib/new_relic/agent/method_tracer.rb +1 -1
- data/lib/new_relic/agent/samplers/cpu_sampler.rb +2 -0
- data/lib/new_relic/agent/stats_engine/metric_stats.rb +1 -1
- data/lib/new_relic/control.rb +1 -0
- data/lib/new_relic/control/instrumentation.rb +1 -0
- data/lib/new_relic/delayed_job_injection.rb +23 -14
- data/lib/new_relic/version.rb +2 -2
- data/lib/newrelic_rpm.rb +5 -0
- data/newrelic_rpm.gemspec +25 -23
- data/test/new_relic/agent/{agent_connect_test.rb → agent/connect_test.rb} +2 -2
- data/test/new_relic/agent/{agent_start_test.rb → agent/start_test.rb} +17 -3
- data/test/new_relic/agent/{agent_start_worker_thread_test.rb → agent/start_worker_thread_test.rb} +2 -2
- data/test/new_relic/agent/{agent_controller_test.rb → agent_test_controller_test.rb} +6 -3
- data/test/new_relic/agent/{error_collector_notice_error_test.rb → error_collector/notice_error_test.rb} +2 -2
- data/test/new_relic/agent/{active_record_instrumentation_test.rb → instrumentation/active_record_instrumentation_test.rb} +2 -2
- data/test/new_relic/agent/{metric_frame_test.rb → instrumentation/metric_frame_test.rb} +2 -3
- data/test/new_relic/agent/{net_instrumentation_test.rb → instrumentation/net_instrumentation_test.rb} +4 -4
- data/test/new_relic/agent/{queue_time_test.rb → instrumentation/queue_time_test.rb} +1 -1
- data/test/new_relic/agent/{task_instrumentation_test.rb → instrumentation/task_instrumentation_test.rb} +29 -32
- data/test/new_relic/agent/method_tracer/class_methods/add_method_tracer_test.rb +165 -0
- data/test/new_relic/agent/{method_tracer_trace_execution_scoped_test.rb → method_tracer/instance_methods/trace_execution_scoped_test.rb} +2 -2
- data/test/new_relic/agent/method_tracer_test.rb +31 -3
- data/test/new_relic/agent/rpm_agent_test.rb +8 -3
- data/test/new_relic/{agent/collection_helper_test.rb → collection_helper_test.rb} +4 -4
- data/test/new_relic/{deployments_api_test.rb → command/deployments_test.rb} +3 -5
- data/test/new_relic/control_test.rb +3 -3
- data/test/new_relic/{environment_test.rb → local_environment_test.rb} +2 -5
- data/test/new_relic/metric_spec_test.rb +32 -122
- data/test/new_relic/stats_test.rb +0 -1
- data/test/new_relic/{agent/transaction_sample_subtest_test.rb → transaction_sample_subtest_test.rb} +0 -0
- data/test/new_relic/{agent/transaction_sample_test.rb → transaction_sample_test.rb} +1 -2
- data/test/test_helper.rb +1 -0
- data/vendor/gems/dependency_detection-0.0.1.build/LICENSE +19 -0
- data/vendor/gems/dependency_detection-0.0.1.build/README +0 -0
- data/vendor/gems/dependency_detection-0.0.1.build/lib/dependency_detection.rb +57 -0
- data/vendor/gems/dependency_detection-0.0.1.build/lib/dependency_detection/version.rb +3 -0
- metadata +29 -27
- data/test/new_relic/agent/add_method_tracer_test.rb +0 -158
- data/test/new_relic/agent/metric_data_test.rb +0 -53
- data/test/new_relic/agent/testable_agent.rb +0 -13
- data/test/new_relic/shim_agent_test.rb +0 -9
@@ -1,46 +1,53 @@
|
|
1
|
-
|
2
|
-
require 'new_relic/agent/instrumentation/controller_instrumentation'
|
3
|
-
module NewRelic
|
4
|
-
module Agent
|
5
|
-
module Instrumentation
|
6
|
-
# NewRelic instrumentation for Sinatra applications. Sinatra actions will
|
7
|
-
# appear in the UI similar to controller actions, and have breakdown charts
|
8
|
-
# and transaction traces.
|
9
|
-
#
|
10
|
-
# The actions in the UI will correspond to the pattern expression used
|
11
|
-
# to match them. HTTP operations are not distinguished. Multiple matches
|
12
|
-
# will all be tracked as separate actions.
|
13
|
-
module Sinatra
|
1
|
+
require 'new_relic/agent/instrumentation/controller_instrumentation'
|
14
2
|
|
15
|
-
|
3
|
+
DependencyDetection.defer do
|
4
|
+
depends_on do
|
5
|
+
defined?(::Sinatra) && defined?(::Sinatra::Base)
|
6
|
+
end
|
7
|
+
|
8
|
+
executes do
|
9
|
+
::Sinatra::Base.class_eval do
|
10
|
+
include NewRelic::Agent::Instrumentation::Sinatra
|
11
|
+
alias route_eval_without_newrelic route_eval
|
12
|
+
alias route_eval route_eval_with_newrelic
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
|
18
|
+
module NewRelic
|
19
|
+
module Agent
|
20
|
+
module Instrumentation
|
21
|
+
# NewRelic instrumentation for Sinatra applications. Sinatra actions will
|
22
|
+
# appear in the UI similar to controller actions, and have breakdown charts
|
23
|
+
# and transaction traces.
|
24
|
+
#
|
25
|
+
# The actions in the UI will correspond to the pattern expression used
|
26
|
+
# to match them. HTTP operations are not distinguished. Multiple matches
|
27
|
+
# will all be tracked as separate actions.
|
28
|
+
module Sinatra
|
16
29
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
30
|
+
include NewRelic::Agent::Instrumentation::ControllerInstrumentation
|
31
|
+
|
32
|
+
def route_eval_with_newrelic(&block_arg)
|
33
|
+
path = unescape(@request.path_info)
|
34
|
+
name = path
|
35
|
+
# Go through each route and look for a match
|
36
|
+
if routes = self.class.routes[@request.request_method]
|
37
|
+
routes.detect do |pattern, keys, conditions, block|
|
38
|
+
if block_arg.equal? block
|
39
|
+
name = pattern.source
|
26
40
|
end
|
27
41
|
end
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
42
|
+
end
|
43
|
+
# strip off leading ^ and / chars and trailing $ and /
|
44
|
+
name.gsub!(%r{^[/^]*(.*?)[/\$\?]*$}, '\1')
|
45
|
+
name = 'root' if name.empty?
|
46
|
+
name = @request.request_method + ' ' + name if @request && @request.respond_to?(:request_method)
|
47
|
+
perform_action_with_newrelic_trace(:category => :sinatra, :name => name, :params => @request.params) do
|
48
|
+
route_eval_without_newrelic(&block_arg)
|
35
49
|
end
|
36
50
|
end
|
37
|
-
|
38
|
-
::Sinatra::Base.class_eval do
|
39
|
-
include NewRelic::Agent::Instrumentation::Sinatra
|
40
|
-
alias route_eval_without_newrelic route_eval
|
41
|
-
alias route_eval route_eval_with_newrelic
|
42
|
-
end
|
43
|
-
|
44
51
|
end
|
45
52
|
end
|
46
53
|
end
|
@@ -1,16 +1,22 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
add_method_tracer method, 'SolrClient/Sunspot/index'
|
6
|
-
end
|
7
|
-
add_method_tracer :commit, 'SolrClient/Sunspot/commit'
|
1
|
+
DependencyDetection.defer do
|
2
|
+
depends_on do
|
3
|
+
defined?(::Sunspot)
|
4
|
+
end
|
8
5
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
6
|
+
executes do
|
7
|
+
::Sunspot.module_eval do
|
8
|
+
class << self
|
9
|
+
%w(index index!).each do |method|
|
10
|
+
add_method_tracer method, 'SolrClient/Sunspot/index'
|
11
|
+
end
|
12
|
+
add_method_tracer :commit, 'SolrClient/Sunspot/commit'
|
13
|
+
|
14
|
+
%w[search more_like_this].each do |method|
|
15
|
+
add_method_tracer method, 'SolrClient/Sunspot/query'
|
16
|
+
end
|
17
|
+
%w[remove remove! remove_by_id remove_by_id! remove_all remove_all!].each do |method|
|
18
|
+
add_method_tracer method, 'SolrClient/Sunspot/delete'
|
19
|
+
end
|
14
20
|
end
|
15
21
|
end
|
16
22
|
end
|
@@ -1,10 +1,16 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
1
|
+
DependencyDetection.defer do
|
2
|
+
depends_on do
|
3
|
+
defined?(::Unicorn) && defined?(::Unicorn::HttpServer)
|
4
|
+
end
|
5
|
+
|
6
|
+
executes do
|
7
|
+
Unicorn::HttpServer.class_eval do
|
8
|
+
NewRelic::Agent.logger.debug "Installing Unicorn worker hook."
|
9
|
+
old_worker_loop = instance_method(:worker_loop)
|
10
|
+
define_method(:worker_loop) do | worker |
|
11
|
+
NewRelic::Agent.after_fork(:force_reconnect => true)
|
12
|
+
old_worker_loop.bind(self).call(worker)
|
13
|
+
end
|
8
14
|
end
|
9
15
|
end
|
10
16
|
end
|
@@ -401,10 +401,10 @@ module NewRelic
|
|
401
401
|
# may get removed as well.
|
402
402
|
def remove_method_tracer(method_name, metric_name_code) # :nodoc:
|
403
403
|
return unless NewRelic::Control.instance.agent_enabled?
|
404
|
-
|
405
404
|
if method_defined? "#{_traced_method_name(method_name, metric_name_code)}"
|
406
405
|
alias_method method_name, "#{_untraced_method_name(method_name, metric_name_code)}"
|
407
406
|
undef_method "#{_traced_method_name(method_name, metric_name_code)}"
|
407
|
+
log.debug("removed method tracer #{method_name} #{metric_name_code}\n")
|
408
408
|
else
|
409
409
|
raise "No tracer for '#{metric_name_code}' on method '#{method_name}'"
|
410
410
|
end
|
data/lib/new_relic/control.rb
CHANGED
@@ -72,6 +72,7 @@ module NewRelic
|
|
72
72
|
File.join(instrumentation_path, '*.rb') <<
|
73
73
|
File.join(instrumentation_path, app.to_s, '*.rb')
|
74
74
|
@instrumentation_files.each { | pattern | load_instrumentation_files pattern }
|
75
|
+
DependencyDetection.detect!
|
75
76
|
log.debug "Finished instrumentation"
|
76
77
|
end
|
77
78
|
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'dependency_detection'
|
1
2
|
# This installs some code to manually start the agent when a delayed job worker starts.
|
2
3
|
# It's not really instrumentation. It's more like a hook from DJ to RPM so it gets
|
3
4
|
# loaded at the time the RPM plugin initializes, which must be before the DJ worker
|
@@ -9,19 +10,27 @@ module NewRelic
|
|
9
10
|
end
|
10
11
|
end
|
11
12
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
worker_name = case
|
16
|
-
when self.respond_to?(:name) then self.name
|
17
|
-
when self.class.respond_to?(:default_name) then self.class.default_name
|
18
|
-
end
|
19
|
-
dispatcher_instance_id = worker_name || "host:#{Socket.gethostname} pid:#{Process.pid}" rescue "pid:#{Process.pid}"
|
20
|
-
say "RPM Monitoring DJ worker #{dispatcher_instance_id}"
|
21
|
-
NewRelic::DelayedJobInjection.worker_name = worker_name
|
22
|
-
NewRelic::Control.instance.init_plugin :dispatcher => :delayed_job, :dispatcher_instance_id => dispatcher_instance_id
|
13
|
+
DependencyDetection.defer do
|
14
|
+
depends_on do
|
15
|
+
defined?(::Delayed) && defined?(::Delayed::Worker) and !NewRelic::Control.instance['disable_dj']
|
23
16
|
end
|
17
|
+
|
18
|
+
executes do
|
19
|
+
Delayed::Worker.class_eval do
|
20
|
+
def initialize_with_new_relic(*args)
|
21
|
+
initialize_without_new_relic(*args)
|
22
|
+
worker_name = case
|
23
|
+
when self.respond_to?(:name) then self.name
|
24
|
+
when self.class.respond_to?(:default_name) then self.class.default_name
|
25
|
+
end
|
26
|
+
dispatcher_instance_id = worker_name || "host:#{Socket.gethostname} pid:#{Process.pid}" rescue "pid:#{Process.pid}"
|
27
|
+
say "RPM Monitoring DJ worker #{dispatcher_instance_id}"
|
28
|
+
NewRelic::DelayedJobInjection.worker_name = worker_name
|
29
|
+
NewRelic::Control.instance.init_plugin :dispatcher => :delayed_job, :dispatcher_instance_id => dispatcher_instance_id
|
30
|
+
end
|
24
31
|
|
25
|
-
|
26
|
-
|
27
|
-
end
|
32
|
+
alias initialize_without_new_relic initialize
|
33
|
+
alias initialize initialize_with_new_relic
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
data/lib/new_relic/version.rb
CHANGED
@@ -3,8 +3,8 @@ module NewRelic
|
|
3
3
|
module VERSION #:nodoc:
|
4
4
|
MAJOR = 2
|
5
5
|
MINOR = 13
|
6
|
-
TINY =
|
7
|
-
BUILD = '
|
6
|
+
TINY = 6
|
7
|
+
BUILD = 'beta1' #'0' # 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
|
|
data/lib/newrelic_rpm.rb
CHANGED
@@ -18,6 +18,7 @@
|
|
18
18
|
# directly.
|
19
19
|
#
|
20
20
|
require 'new_relic/control'
|
21
|
+
|
21
22
|
if defined? Merb
|
22
23
|
module NewRelic
|
23
24
|
class MerbBootLoader < Merb::BootLoader
|
@@ -38,10 +39,14 @@ elsif defined? Rails
|
|
38
39
|
end
|
39
40
|
end
|
40
41
|
else
|
42
|
+
if Rails.respond_to?(:configuration)
|
41
43
|
# After verison 2.0 of Rails we can access the configuration directly.
|
42
44
|
# We need it to add dev mode routes after initialization finished.
|
43
45
|
config = Rails.configuration
|
44
46
|
NewRelic::Control.instance.init_plugin :config => config
|
47
|
+
else
|
48
|
+
NewRelic::Control.instance.init_plugin
|
49
|
+
end
|
45
50
|
end
|
46
51
|
else
|
47
52
|
NewRelic::Control.instance.init_plugin
|
data/newrelic_rpm.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{newrelic_rpm}
|
8
|
-
s.version = "2.13.
|
8
|
+
s.version = "2.13.6.beta1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Bill Kayser", "Justin George"]
|
12
|
-
s.date = %q{2011-03-
|
12
|
+
s.date = %q{2011-03-21}
|
13
13
|
s.description = %q{New Relic RPM is a Ruby performance management system, developed by
|
14
14
|
New Relic, Inc (http://www.newrelic.com). RPM provides you with deep
|
15
15
|
information about the performance of your Ruby on Rails or Merb
|
@@ -18,7 +18,7 @@ dual-purposed as a either a Rails plugin or a Gem, hosted on
|
|
18
18
|
http://github.com/newrelic/rpm/tree/master.
|
19
19
|
}
|
20
20
|
s.email = %q{support@newrelic.com}
|
21
|
-
s.executables = ["
|
21
|
+
s.executables = ["newrelic_cmd", "newrelic", "mongrel_rpm"]
|
22
22
|
s.extra_rdoc_files = [
|
23
23
|
"CHANGELOG",
|
24
24
|
"LICENSE",
|
@@ -34,6 +34,7 @@ http://github.com/newrelic/rpm/tree/master.
|
|
34
34
|
"bin/newrelic_cmd",
|
35
35
|
"cert/cacert.pem",
|
36
36
|
"install.rb",
|
37
|
+
"lib/conditional_vendored_dependency_detection.rb",
|
37
38
|
"lib/conditional_vendored_metric_parser.rb",
|
38
39
|
"lib/new_relic/agent.rb",
|
39
40
|
"lib/new_relic/agent/agent.rb",
|
@@ -124,44 +125,41 @@ http://github.com/newrelic/rpm/tree/master.
|
|
124
125
|
"test/active_record_fixtures.rb",
|
125
126
|
"test/config/newrelic.yml",
|
126
127
|
"test/config/test_control.rb",
|
127
|
-
"test/new_relic/agent/
|
128
|
-
"test/new_relic/agent/
|
129
|
-
"test/new_relic/agent/
|
130
|
-
"test/new_relic/agent/agent_controller_test.rb",
|
131
|
-
"test/new_relic/agent/agent_start_test.rb",
|
132
|
-
"test/new_relic/agent/agent_start_worker_thread_test.rb",
|
128
|
+
"test/new_relic/agent/agent/connect_test.rb",
|
129
|
+
"test/new_relic/agent/agent/start_test.rb",
|
130
|
+
"test/new_relic/agent/agent/start_worker_thread_test.rb",
|
133
131
|
"test/new_relic/agent/agent_test_controller.rb",
|
132
|
+
"test/new_relic/agent/agent_test_controller_test.rb",
|
134
133
|
"test/new_relic/agent/apdex_from_server_test.rb",
|
135
134
|
"test/new_relic/agent/busy_calculator_test.rb",
|
136
|
-
"test/new_relic/agent/
|
137
|
-
"test/new_relic/agent/error_collector_notice_error_test.rb",
|
135
|
+
"test/new_relic/agent/error_collector/notice_error_test.rb",
|
138
136
|
"test/new_relic/agent/error_collector_test.rb",
|
137
|
+
"test/new_relic/agent/instrumentation/active_record_instrumentation_test.rb",
|
138
|
+
"test/new_relic/agent/instrumentation/metric_frame_test.rb",
|
139
|
+
"test/new_relic/agent/instrumentation/net_instrumentation_test.rb",
|
140
|
+
"test/new_relic/agent/instrumentation/queue_time_test.rb",
|
141
|
+
"test/new_relic/agent/instrumentation/task_instrumentation_test.rb",
|
139
142
|
"test/new_relic/agent/memcache_instrumentation_test.rb",
|
143
|
+
"test/new_relic/agent/method_tracer/class_methods/add_method_tracer_test.rb",
|
144
|
+
"test/new_relic/agent/method_tracer/instance_methods/trace_execution_scoped_test.rb",
|
140
145
|
"test/new_relic/agent/method_tracer_test.rb",
|
141
|
-
"test/new_relic/agent/method_tracer_trace_execution_scoped_test.rb",
|
142
|
-
"test/new_relic/agent/metric_data_test.rb",
|
143
|
-
"test/new_relic/agent/metric_frame_test.rb",
|
144
146
|
"test/new_relic/agent/mock_scope_listener.rb",
|
145
|
-
"test/new_relic/agent/net_instrumentation_test.rb",
|
146
|
-
"test/new_relic/agent/queue_time_test.rb",
|
147
147
|
"test/new_relic/agent/rpm_agent_test.rb",
|
148
148
|
"test/new_relic/agent/stats_engine/metric_stats_test.rb",
|
149
149
|
"test/new_relic/agent/stats_engine/samplers_test.rb",
|
150
150
|
"test/new_relic/agent/stats_engine/stats_engine_test.rb",
|
151
|
-
"test/new_relic/agent/task_instrumentation_test.rb",
|
152
|
-
"test/new_relic/agent/testable_agent.rb",
|
153
151
|
"test/new_relic/agent/transaction_sample_builder_test.rb",
|
154
|
-
"test/new_relic/agent/transaction_sample_subtest_test.rb",
|
155
|
-
"test/new_relic/agent/transaction_sample_test.rb",
|
156
152
|
"test/new_relic/agent/transaction_sampler_test.rb",
|
157
153
|
"test/new_relic/agent/worker_loop_test.rb",
|
154
|
+
"test/new_relic/collection_helper_test.rb",
|
155
|
+
"test/new_relic/command/deployments_test.rb",
|
158
156
|
"test/new_relic/control_test.rb",
|
159
|
-
"test/new_relic/
|
160
|
-
"test/new_relic/environment_test.rb",
|
157
|
+
"test/new_relic/local_environment_test.rb",
|
161
158
|
"test/new_relic/metric_spec_test.rb",
|
162
159
|
"test/new_relic/rack/episodes_test.rb",
|
163
|
-
"test/new_relic/shim_agent_test.rb",
|
164
160
|
"test/new_relic/stats_test.rb",
|
161
|
+
"test/new_relic/transaction_sample_subtest_test.rb",
|
162
|
+
"test/new_relic/transaction_sample_test.rb",
|
165
163
|
"test/new_relic/version_number_test.rb",
|
166
164
|
"test/test_contexts.rb",
|
167
165
|
"test/test_helper.rb",
|
@@ -196,6 +194,10 @@ http://github.com/newrelic/rpm/tree/master.
|
|
196
194
|
"ui/views/newrelic/show_sample.rhtml",
|
197
195
|
"ui/views/newrelic/show_source.rhtml",
|
198
196
|
"ui/views/newrelic/threads.rhtml",
|
197
|
+
"vendor/gems/dependency_detection-0.0.1.build/LICENSE",
|
198
|
+
"vendor/gems/dependency_detection-0.0.1.build/README",
|
199
|
+
"vendor/gems/dependency_detection-0.0.1.build/lib/dependency_detection.rb",
|
200
|
+
"vendor/gems/dependency_detection-0.0.1.build/lib/dependency_detection/version.rb",
|
199
201
|
"vendor/gems/metric_parser-0.1.0.pre1/LICENSE",
|
200
202
|
"vendor/gems/metric_parser-0.1.0.pre1/README",
|
201
203
|
"vendor/gems/metric_parser-0.1.0.pre1/lib/metric_parser.rb",
|
@@ -1,5 +1,5 @@
|
|
1
|
-
require File.expand_path(File.join(File.dirname(__FILE__),'..','..','test_helper'))
|
2
|
-
class NewRelic::Agent::
|
1
|
+
require File.expand_path(File.join(File.dirname(__FILE__),'..', '..', '..','test_helper'))
|
2
|
+
class NewRelic::Agent::Agent::ConnectTest < Test::Unit::TestCase
|
3
3
|
require 'new_relic/agent/agent'
|
4
4
|
include NewRelic::Agent::Agent::Connect
|
5
5
|
|
@@ -1,5 +1,5 @@
|
|
1
|
-
require File.expand_path(File.join(File.dirname(__FILE__),'..','..','test_helper'))
|
2
|
-
class NewRelic::Agent::
|
1
|
+
require File.expand_path(File.join(File.dirname(__FILE__),'..','..','..','test_helper'))
|
2
|
+
class NewRelic::Agent::Agent::StartTest < Test::Unit::TestCase
|
3
3
|
require 'new_relic/agent/agent'
|
4
4
|
include NewRelic::Agent::Agent::Start
|
5
5
|
|
@@ -73,11 +73,18 @@ class NewRelic::Agent::AgentStartTest < Test::Unit::TestCase
|
|
73
73
|
assert_equal :obfuscated, @record_sql, " should default to :obfuscated, was #{@record_sql}"
|
74
74
|
end
|
75
75
|
|
76
|
+
def test_set_sql_recording_off
|
77
|
+
self.expects(:sampler_config).returns({'record_sql' => 'off'})
|
78
|
+
self.expects(:log_sql_transmission_warning?)
|
79
|
+
set_sql_recording!
|
80
|
+
assert_equal :off, @record_sql, "should be set to :off, was #{@record_sql}"
|
81
|
+
end
|
82
|
+
|
76
83
|
def test_set_sql_recording_none
|
77
84
|
self.expects(:sampler_config).returns({'record_sql' => 'none'})
|
78
85
|
self.expects(:log_sql_transmission_warning?)
|
79
86
|
set_sql_recording!
|
80
|
-
assert_equal :
|
87
|
+
assert_equal :off, @record_sql, "should be set to :off, was #{@record_sql}"
|
81
88
|
end
|
82
89
|
|
83
90
|
def test_set_sql_recording_raw
|
@@ -87,6 +94,13 @@ class NewRelic::Agent::AgentStartTest < Test::Unit::TestCase
|
|
87
94
|
assert_equal :raw, @record_sql, "should be set to :raw, was #{@record_sql}"
|
88
95
|
end
|
89
96
|
|
97
|
+
def test_set_sql_recording_falsy
|
98
|
+
self.expects(:sampler_config).returns({'record_sql' => false})
|
99
|
+
self.expects(:log_sql_transmission_warning?)
|
100
|
+
set_sql_recording!
|
101
|
+
assert_equal :off, @record_sql, "should be set to :off, was #{@record_sql}"
|
102
|
+
end
|
103
|
+
|
90
104
|
def test_log_sql_transmission_warning_negative
|
91
105
|
log = mocked_log
|
92
106
|
@record_sql = :obfuscated
|
data/test/new_relic/agent/{agent_start_worker_thread_test.rb → agent/start_worker_thread_test.rb}
RENAMED
@@ -1,5 +1,5 @@
|
|
1
|
-
require File.expand_path(File.join(File.dirname(__FILE__),'..','..','test_helper'))
|
2
|
-
class NewRelic::Agent::
|
1
|
+
require File.expand_path(File.join(File.dirname(__FILE__),'..','..','..','test_helper'))
|
2
|
+
class NewRelic::Agent::Agent::StartWorkerThreadTest < Test::Unit::TestCase
|
3
3
|
require 'new_relic/agent/agent'
|
4
4
|
include NewRelic::Agent::Agent::StartWorkerThread
|
5
5
|
|