ghazel-newrelic_rpm 3.1.0.1 → 3.4.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +120 -35
- data/LICENSE +29 -2
- data/README.rdoc +2 -2
- data/bin/mongrel_rpm +0 -0
- data/bin/newrelic +0 -0
- data/bin/newrelic_cmd +0 -0
- data/lib/new_relic/agent.rb +50 -38
- data/lib/new_relic/agent/agent.rb +459 -337
- data/lib/new_relic/agent/beacon_configuration.rb +71 -11
- data/lib/new_relic/agent/browser_monitoring.rb +73 -14
- data/lib/new_relic/agent/busy_calculator.rb +11 -3
- data/lib/new_relic/agent/chained_call.rb +2 -2
- data/lib/new_relic/agent/database.rb +223 -0
- data/lib/new_relic/agent/error_collector.rb +231 -183
- data/lib/new_relic/agent/instrumentation.rb +2 -2
- data/lib/new_relic/agent/instrumentation/active_merchant.rb +10 -2
- data/lib/new_relic/agent/instrumentation/active_record.rb +138 -0
- data/lib/new_relic/agent/instrumentation/acts_as_solr.rb +7 -1
- data/lib/new_relic/agent/instrumentation/authlogic.rb +6 -0
- data/lib/new_relic/agent/instrumentation/controller_instrumentation.rb +46 -14
- data/lib/new_relic/agent/instrumentation/data_mapper.rb +8 -2
- data/lib/new_relic/agent/instrumentation/delayed_job_instrumentation.rb +11 -3
- data/lib/new_relic/agent/instrumentation/memcache.rb +49 -25
- data/lib/new_relic/agent/instrumentation/merb/controller.rb +7 -2
- data/lib/new_relic/agent/instrumentation/merb/errors.rb +7 -1
- data/lib/new_relic/agent/instrumentation/metric_frame.rb +31 -4
- data/lib/new_relic/agent/instrumentation/metric_frame/pop.rb +1 -5
- data/lib/new_relic/agent/instrumentation/net.rb +8 -2
- data/lib/new_relic/agent/instrumentation/passenger_instrumentation.rb +5 -2
- data/lib/new_relic/agent/instrumentation/queue_time.rb +1 -1
- data/lib/new_relic/agent/instrumentation/rails/action_controller.rb +66 -35
- data/lib/new_relic/agent/instrumentation/rails/action_web_service.rb +7 -1
- data/lib/new_relic/agent/instrumentation/rails/errors.rb +7 -1
- data/lib/new_relic/agent/instrumentation/rails3/action_controller.rb +121 -1
- data/lib/new_relic/agent/instrumentation/rails3/errors.rb +7 -1
- data/lib/new_relic/agent/instrumentation/rainbows_instrumentation.rb +21 -0
- data/lib/new_relic/agent/instrumentation/resque.rb +80 -0
- data/lib/new_relic/agent/instrumentation/sinatra.rb +46 -20
- data/lib/new_relic/agent/instrumentation/sunspot.rb +6 -0
- data/lib/new_relic/agent/instrumentation/unicorn_instrumentation.rb +7 -2
- data/lib/new_relic/agent/method_tracer.rb +205 -99
- data/lib/new_relic/agent/new_relic_service.rb +221 -0
- data/lib/new_relic/agent/pipe_channel_manager.rb +161 -0
- data/lib/new_relic/agent/pipe_service.rb +54 -0
- data/lib/new_relic/agent/samplers/delayed_job_sampler.rb +89 -0
- data/lib/new_relic/agent/samplers/memory_sampler.rb +6 -7
- data/lib/new_relic/agent/shim_agent.rb +5 -5
- data/lib/new_relic/agent/sql_sampler.rb +282 -0
- data/lib/new_relic/agent/stats_engine.rb +2 -0
- data/lib/new_relic/agent/stats_engine/gc_profiler.rb +123 -0
- data/lib/new_relic/agent/stats_engine/metric_stats.rb +35 -30
- data/lib/new_relic/agent/stats_engine/samplers.rb +10 -4
- data/lib/new_relic/agent/stats_engine/transactions.rb +28 -87
- data/lib/new_relic/agent/transaction_info.rb +74 -0
- data/lib/new_relic/agent/transaction_sample_builder.rb +18 -3
- data/lib/new_relic/agent/transaction_sampler.rb +108 -20
- data/lib/new_relic/agent/worker_loop.rb +14 -6
- data/lib/new_relic/collection_helper.rb +19 -11
- data/lib/new_relic/command.rb +1 -1
- data/lib/new_relic/commands/deployments.rb +2 -2
- data/lib/new_relic/commands/install.rb +2 -13
- data/lib/new_relic/control.rb +2 -3
- data/lib/new_relic/control/class_methods.rb +12 -6
- data/lib/new_relic/control/configuration.rb +57 -8
- data/lib/new_relic/control/frameworks.rb +10 -0
- data/lib/new_relic/control/frameworks/external.rb +4 -4
- data/lib/new_relic/control/frameworks/merb.rb +2 -1
- data/lib/new_relic/control/frameworks/rails.rb +35 -22
- data/lib/new_relic/control/frameworks/rails3.rb +12 -7
- data/lib/new_relic/control/frameworks/ruby.rb +5 -5
- data/lib/new_relic/control/frameworks/sinatra.rb +1 -4
- data/lib/new_relic/control/instance_methods.rb +38 -12
- data/lib/new_relic/control/instrumentation.rb +23 -4
- data/lib/new_relic/control/logging_methods.rb +70 -15
- data/lib/new_relic/control/server_methods.rb +22 -9
- data/lib/new_relic/delayed_job_injection.rb +16 -3
- data/lib/new_relic/helper.rb +21 -0
- data/lib/new_relic/language_support.rb +95 -0
- data/lib/new_relic/local_environment.rb +92 -48
- data/lib/new_relic/metric_data.rb +7 -2
- data/lib/new_relic/metric_spec.rb +12 -9
- data/lib/new_relic/noticed_error.rb +6 -1
- data/lib/new_relic/rack/browser_monitoring.rb +18 -19
- data/lib/new_relic/rack/developer_mode.rb +3 -2
- data/lib/new_relic/recipes.rb +8 -4
- data/lib/new_relic/stats.rb +17 -60
- data/lib/new_relic/transaction_analysis.rb +2 -1
- data/lib/new_relic/transaction_analysis/segment_summary.rb +4 -2
- data/lib/new_relic/transaction_sample.rb +60 -75
- data/lib/new_relic/transaction_sample/segment.rb +31 -79
- data/lib/new_relic/version.rb +2 -2
- data/lib/newrelic_rpm.rb +1 -1
- data/newrelic.yml +2 -2
- data/newrelic_rpm.gemspec +46 -54
- data/test/active_record_fixtures.rb +3 -3
- data/test/config/newrelic.yml +1 -1
- data/test/fixtures/proc_cpuinfo.txt +575 -0
- data/test/new_relic/agent/agent/connect_test.rb +128 -25
- data/test/new_relic/agent/agent/start_test.rb +9 -94
- data/test/new_relic/agent/agent/start_worker_thread_test.rb +2 -4
- data/test/new_relic/agent/agent_test.rb +51 -78
- data/test/new_relic/agent/agent_test_controller.rb +1 -1
- data/test/new_relic/agent/agent_test_controller_test.rb +49 -33
- data/test/new_relic/agent/beacon_configuration_test.rb +12 -5
- data/test/new_relic/agent/browser_monitoring_test.rb +99 -50
- data/test/new_relic/agent/database_test.rb +161 -0
- data/test/new_relic/agent/error_collector_test.rb +47 -23
- data/test/new_relic/agent/instrumentation/active_record_instrumentation_test.rb +96 -42
- data/test/new_relic/agent/instrumentation/controller_instrumentation_test.rb +0 -2
- data/test/new_relic/agent/instrumentation/instrumentation_test.rb +1 -1
- data/test/new_relic/agent/instrumentation/metric_frame/pop_test.rb +3 -11
- data/test/new_relic/agent/instrumentation/net_instrumentation_test.rb +9 -9
- data/test/new_relic/agent/instrumentation/queue_time_test.rb +6 -11
- data/test/new_relic/agent/memcache_instrumentation_test.rb +54 -18
- data/test/new_relic/agent/method_tracer/class_methods/add_method_tracer_test.rb +1 -1
- data/test/new_relic/agent/method_tracer/instance_methods/trace_execution_scoped_test.rb +1 -1
- data/test/new_relic/agent/method_tracer_test.rb +3 -2
- data/test/new_relic/agent/new_relic_service_test.rb +151 -0
- data/test/new_relic/agent/pipe_channel_manager_test.rb +114 -0
- data/test/new_relic/agent/pipe_service_test.rb +113 -0
- data/test/new_relic/agent/rpm_agent_test.rb +4 -31
- data/test/new_relic/agent/sql_sampler_test.rb +192 -0
- data/test/new_relic/agent/stats_engine/metric_stats_test.rb +19 -18
- data/test/new_relic/agent/stats_engine_test.rb +41 -6
- data/test/new_relic/agent/transaction_info_test.rb +13 -0
- data/test/new_relic/agent/transaction_sample_builder_test.rb +27 -4
- data/test/new_relic/agent/transaction_sampler_test.rb +68 -46
- data/test/new_relic/agent/worker_loop_test.rb +3 -3
- data/test/new_relic/agent_test.rb +242 -0
- data/test/new_relic/collection_helper_test.rb +50 -28
- data/test/new_relic/control/configuration_test.rb +77 -0
- data/test/new_relic/control/logging_methods_test.rb +49 -21
- data/test/new_relic/control_test.rb +115 -54
- data/test/new_relic/delayed_job_injection_test.rb +21 -0
- data/test/new_relic/fake_collector.rb +210 -0
- data/test/new_relic/fake_service.rb +44 -0
- data/test/new_relic/local_environment_test.rb +14 -1
- data/test/new_relic/metric_parser/metric_parser_test.rb +11 -0
- data/test/new_relic/rack/browser_monitoring_test.rb +84 -23
- data/test/new_relic/rack/developer_mode_helper_test.rb +141 -0
- data/test/new_relic/rack/developer_mode_test.rb +31 -0
- data/test/new_relic/stats_test.rb +3 -18
- data/test/new_relic/transaction_analysis/segment_summary_test.rb +14 -0
- data/test/new_relic/transaction_analysis_test.rb +3 -3
- data/test/new_relic/transaction_sample/segment_test.rb +15 -80
- data/test/new_relic/transaction_sample_test.rb +25 -18
- data/test/script/build_test_gem.sh +51 -0
- data/test/script/ci.sh +140 -0
- data/test/script/ci_agent-tests_runner.sh +82 -0
- data/test/script/ci_bench.sh +52 -0
- data/test/script/ci_multiverse_runner.sh +63 -0
- data/test/test_contexts.rb +1 -0
- data/test/test_helper.rb +18 -5
- data/ui/helpers/developer_mode_helper.rb +14 -8
- data/ui/helpers/google_pie_chart.rb +0 -1
- data/ui/views/newrelic/index.rhtml +2 -2
- data/vendor/gems/dependency_detection-0.0.1.build/LICENSE +4 -18
- data/vendor/gems/dependency_detection-0.0.1.build/lib/dependency_detection.rb +10 -0
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/mem_cache.rb +11 -11
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/metric_parser.rb +17 -4
- data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/view.rb +4 -0
- metadata +50 -36
- data/lib/new_relic/agent/instrumentation/rails/active_record_instrumentation.rb +0 -108
- data/lib/new_relic/agent/instrumentation/rails3/active_record_instrumentation.rb +0 -112
- data/lib/new_relic/agent/samplers/delayed_job_lock_sampler.rb +0 -40
- data/lib/new_relic/data_serialization.rb +0 -84
- data/lib/new_relic/histogram.rb +0 -91
- data/lib/new_relic/rack/metric_app.rb +0 -65
- data/lib/new_relic/rack/mongrel_rpm.ru +0 -28
- data/lib/new_relic/rack/newrelic.yml +0 -27
- data/lib/new_relic/rack_app.rb +0 -6
- data/test/new_relic/data_serialization_test.rb +0 -70
- data/vendor/gems/dependency_detection-0.0.1.build/README +0 -0
- data/vendor/gems/metric_parser-0.1.0.pre1/LICENSE +0 -0
- data/vendor/gems/metric_parser-0.1.0.pre1/README +0 -0
@@ -8,12 +8,22 @@ module NewRelic
|
|
8
8
|
# Load in the parsers classes in the plugin:
|
9
9
|
Dir[File.join(File.dirname(__FILE__), "metric_parser", "*.rb")].each { | file | require file }
|
10
10
|
|
11
|
+
def self.category_is_constant(category)
|
12
|
+
@string_constants ||= (
|
13
|
+
NewRelic::MetricParser.constants.inject({}){|memo, const| memo[const.to_s] = true; memo}
|
14
|
+
)
|
15
|
+
@string_constants[category]
|
16
|
+
end
|
11
17
|
# return a string that is parsable via the Metric parser APIs
|
12
18
|
def self.for_metric_named(s)
|
13
19
|
category = (s =~ /^([^\/]*)/) && $1
|
14
20
|
parser_class = self
|
15
|
-
if category
|
16
|
-
|
21
|
+
if category_is_constant(category)
|
22
|
+
begin
|
23
|
+
parser_class = NewRelic::MetricParser.const_get(category)
|
24
|
+
rescue
|
25
|
+
nil
|
26
|
+
end
|
17
27
|
end
|
18
28
|
parser_class.new s
|
19
29
|
end
|
@@ -71,9 +81,12 @@ module NewRelic
|
|
71
81
|
segments[0]
|
72
82
|
end
|
73
83
|
|
84
|
+
|
85
|
+
EMPTY_SEGMENTS_HASH = [].freeze
|
86
|
+
SEGMENTS_CACHE = {}
|
74
87
|
def segments
|
75
|
-
|
76
|
-
|
88
|
+
name || (return EMPTY_SEGMENTS_HASH)
|
89
|
+
SEGMENTS_CACHE[name] ||= name.split(SEPARATOR).freeze
|
77
90
|
end
|
78
91
|
|
79
92
|
# --
|
@@ -16,6 +16,8 @@ module NewRelic
|
|
16
16
|
"#{file_name(segments[-2])} Template"
|
17
17
|
when "Partial"
|
18
18
|
"#{file_name(segments[-2])} Partial"
|
19
|
+
when "Collection"
|
20
|
+
"#{file_name(segments[-2])} Collection"
|
19
21
|
when ".rhtml Processing"
|
20
22
|
"ERB compilation"
|
21
23
|
else
|
@@ -28,6 +30,8 @@ module NewRelic
|
|
28
30
|
"#{file_name(segments[1..-2].join(NewRelic::MetricParser::MetricParser::SEPARATOR))} Template"
|
29
31
|
when "Partial"
|
30
32
|
"#{file_name(segments[1..-2].join(NewRelic::MetricParser::MetricParser::SEPARATOR))} Partial"
|
33
|
+
when "Collection"
|
34
|
+
"#{file_name(segments[1..-2].join(NewRelic::MetricParser::MetricParser::SEPARATOR))} Collection"
|
31
35
|
when ".rhtml Processing"
|
32
36
|
"ERB compilation"
|
33
37
|
else
|
metadata
CHANGED
@@ -1,34 +1,33 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ghazel-newrelic_rpm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
4
|
+
prerelease: false
|
6
5
|
segments:
|
7
6
|
- 3
|
8
|
-
-
|
7
|
+
- 4
|
9
8
|
- 0
|
10
|
-
-
|
11
|
-
version: 3.
|
9
|
+
- 2
|
10
|
+
version: 3.4.0.2
|
12
11
|
platform: ruby
|
13
12
|
authors:
|
14
13
|
- Bill Kayser
|
14
|
+
- Jon Guymon
|
15
15
|
- Justin George
|
16
|
+
- Darin Swanson
|
16
17
|
autorequire:
|
17
18
|
bindir: bin
|
18
19
|
cert_chain: []
|
19
20
|
|
20
|
-
date:
|
21
|
+
date: 2012-06-25 00:00:00 -07:00
|
21
22
|
default_executable:
|
22
23
|
dependencies:
|
23
24
|
- !ruby/object:Gem::Dependency
|
24
25
|
name: jeweler
|
25
26
|
prerelease: false
|
26
27
|
requirement: &id001 !ruby/object:Gem::Requirement
|
27
|
-
none: false
|
28
28
|
requirements:
|
29
29
|
- - ">="
|
30
30
|
- !ruby/object:Gem::Version
|
31
|
-
hash: 3
|
32
31
|
segments:
|
33
32
|
- 0
|
34
33
|
version: "0"
|
@@ -38,11 +37,9 @@ dependencies:
|
|
38
37
|
name: mocha
|
39
38
|
prerelease: false
|
40
39
|
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
40
|
requirements:
|
43
41
|
- - ">="
|
44
42
|
- !ruby/object:Gem::Version
|
45
|
-
hash: 3
|
46
43
|
segments:
|
47
44
|
- 0
|
48
45
|
version: "0"
|
@@ -52,11 +49,9 @@ dependencies:
|
|
52
49
|
name: shoulda
|
53
50
|
prerelease: false
|
54
51
|
requirement: &id003 !ruby/object:Gem::Requirement
|
55
|
-
none: false
|
56
52
|
requirements:
|
57
53
|
- - ">="
|
58
54
|
- !ruby/object:Gem::Version
|
59
|
-
hash: 3
|
60
55
|
segments:
|
61
56
|
- 0
|
62
57
|
version: "0"
|
@@ -72,9 +67,9 @@ description: |
|
|
72
67
|
|
73
68
|
email: support@newrelic.com
|
74
69
|
executables:
|
75
|
-
- newrelic_cmd
|
76
|
-
- newrelic
|
77
70
|
- mongrel_rpm
|
71
|
+
- newrelic
|
72
|
+
- newrelic_cmd
|
78
73
|
extensions: []
|
79
74
|
|
80
75
|
extra_rdoc_files:
|
@@ -101,9 +96,11 @@ files:
|
|
101
96
|
- lib/new_relic/agent/browser_monitoring.rb
|
102
97
|
- lib/new_relic/agent/busy_calculator.rb
|
103
98
|
- lib/new_relic/agent/chained_call.rb
|
99
|
+
- lib/new_relic/agent/database.rb
|
104
100
|
- lib/new_relic/agent/error_collector.rb
|
105
101
|
- lib/new_relic/agent/instrumentation.rb
|
106
102
|
- lib/new_relic/agent/instrumentation/active_merchant.rb
|
103
|
+
- lib/new_relic/agent/instrumentation/active_record.rb
|
107
104
|
- lib/new_relic/agent/instrumentation/acts_as_solr.rb
|
108
105
|
- lib/new_relic/agent/instrumentation/authlogic.rb
|
109
106
|
- lib/new_relic/agent/instrumentation/controller_instrumentation.rb
|
@@ -120,25 +117,31 @@ files:
|
|
120
117
|
- lib/new_relic/agent/instrumentation/rack.rb
|
121
118
|
- lib/new_relic/agent/instrumentation/rails/action_controller.rb
|
122
119
|
- lib/new_relic/agent/instrumentation/rails/action_web_service.rb
|
123
|
-
- lib/new_relic/agent/instrumentation/rails/active_record_instrumentation.rb
|
124
120
|
- lib/new_relic/agent/instrumentation/rails/errors.rb
|
125
121
|
- lib/new_relic/agent/instrumentation/rails3/action_controller.rb
|
126
|
-
- lib/new_relic/agent/instrumentation/rails3/active_record_instrumentation.rb
|
127
122
|
- lib/new_relic/agent/instrumentation/rails3/errors.rb
|
123
|
+
- lib/new_relic/agent/instrumentation/resque.rb
|
128
124
|
- lib/new_relic/agent/instrumentation/sinatra.rb
|
129
125
|
- lib/new_relic/agent/instrumentation/sunspot.rb
|
130
126
|
- lib/new_relic/agent/instrumentation/unicorn_instrumentation.rb
|
127
|
+
- lib/new_relic/agent/instrumentation/rainbows_instrumentation.rb
|
131
128
|
- lib/new_relic/agent/method_tracer.rb
|
129
|
+
- lib/new_relic/agent/new_relic_service.rb
|
130
|
+
- lib/new_relic/agent/pipe_channel_manager.rb
|
131
|
+
- lib/new_relic/agent/pipe_service.rb
|
132
132
|
- lib/new_relic/agent/sampler.rb
|
133
133
|
- lib/new_relic/agent/samplers/cpu_sampler.rb
|
134
|
-
- lib/new_relic/agent/samplers/
|
134
|
+
- lib/new_relic/agent/samplers/delayed_job_sampler.rb
|
135
135
|
- lib/new_relic/agent/samplers/memory_sampler.rb
|
136
136
|
- lib/new_relic/agent/samplers/object_sampler.rb
|
137
137
|
- lib/new_relic/agent/shim_agent.rb
|
138
|
+
- lib/new_relic/agent/sql_sampler.rb
|
138
139
|
- lib/new_relic/agent/stats_engine.rb
|
140
|
+
- lib/new_relic/agent/stats_engine/gc_profiler.rb
|
139
141
|
- lib/new_relic/agent/stats_engine/metric_stats.rb
|
140
142
|
- lib/new_relic/agent/stats_engine/samplers.rb
|
141
143
|
- lib/new_relic/agent/stats_engine/transactions.rb
|
144
|
+
- lib/new_relic/agent/transaction_info.rb
|
142
145
|
- lib/new_relic/agent/transaction_sample_builder.rb
|
143
146
|
- lib/new_relic/agent/transaction_sampler.rb
|
144
147
|
- lib/new_relic/agent/worker_loop.rb
|
@@ -149,6 +152,7 @@ files:
|
|
149
152
|
- lib/new_relic/control.rb
|
150
153
|
- lib/new_relic/control/class_methods.rb
|
151
154
|
- lib/new_relic/control/configuration.rb
|
155
|
+
- lib/new_relic/control/frameworks.rb
|
152
156
|
- lib/new_relic/control/frameworks/external.rb
|
153
157
|
- lib/new_relic/control/frameworks/merb.rb
|
154
158
|
- lib/new_relic/control/frameworks/rails.rb
|
@@ -160,9 +164,9 @@ files:
|
|
160
164
|
- lib/new_relic/control/logging_methods.rb
|
161
165
|
- lib/new_relic/control/profiling.rb
|
162
166
|
- lib/new_relic/control/server_methods.rb
|
163
|
-
- lib/new_relic/data_serialization.rb
|
164
167
|
- lib/new_relic/delayed_job_injection.rb
|
165
|
-
- lib/new_relic/
|
168
|
+
- lib/new_relic/helper.rb
|
169
|
+
- lib/new_relic/language_support.rb
|
166
170
|
- lib/new_relic/local_environment.rb
|
167
171
|
- lib/new_relic/merbtasks.rb
|
168
172
|
- lib/new_relic/metric_data.rb
|
@@ -171,10 +175,6 @@ files:
|
|
171
175
|
- lib/new_relic/noticed_error.rb
|
172
176
|
- lib/new_relic/rack/browser_monitoring.rb
|
173
177
|
- lib/new_relic/rack/developer_mode.rb
|
174
|
-
- lib/new_relic/rack/metric_app.rb
|
175
|
-
- lib/new_relic/rack/mongrel_rpm.ru
|
176
|
-
- lib/new_relic/rack/newrelic.yml
|
177
|
-
- lib/new_relic/rack_app.rb
|
178
178
|
- lib/new_relic/recipes.rb
|
179
179
|
- lib/new_relic/stats.rb
|
180
180
|
- lib/new_relic/timer_lib.rb
|
@@ -197,6 +197,7 @@ files:
|
|
197
197
|
- test/active_record_fixtures.rb
|
198
198
|
- test/config/newrelic.yml
|
199
199
|
- test/config/test_control.rb
|
200
|
+
- test/fixtures/proc_cpuinfo.txt
|
200
201
|
- test/new_relic/agent/agent/connect_test.rb
|
201
202
|
- test/new_relic/agent/agent/start_test.rb
|
202
203
|
- test/new_relic/agent/agent/start_worker_thread_test.rb
|
@@ -207,6 +208,7 @@ files:
|
|
207
208
|
- test/new_relic/agent/beacon_configuration_test.rb
|
208
209
|
- test/new_relic/agent/browser_monitoring_test.rb
|
209
210
|
- test/new_relic/agent/busy_calculator_test.rb
|
211
|
+
- test/new_relic/agent/database_test.rb
|
210
212
|
- test/new_relic/agent/error_collector/notice_error_test.rb
|
211
213
|
- test/new_relic/agent/error_collector_test.rb
|
212
214
|
- test/new_relic/agent/instrumentation/active_record_instrumentation_test.rb
|
@@ -223,27 +225,38 @@ files:
|
|
223
225
|
- test/new_relic/agent/method_tracer/instance_methods/trace_execution_scoped_test.rb
|
224
226
|
- test/new_relic/agent/method_tracer_test.rb
|
225
227
|
- test/new_relic/agent/mock_scope_listener.rb
|
228
|
+
- test/new_relic/agent/new_relic_service_test.rb
|
229
|
+
- test/new_relic/agent/pipe_channel_manager_test.rb
|
230
|
+
- test/new_relic/agent/pipe_service_test.rb
|
226
231
|
- test/new_relic/agent/rpm_agent_test.rb
|
227
232
|
- test/new_relic/agent/sampler_test.rb
|
228
233
|
- test/new_relic/agent/shim_agent_test.rb
|
234
|
+
- test/new_relic/agent/sql_sampler_test.rb
|
229
235
|
- test/new_relic/agent/stats_engine/metric_stats/harvest_test.rb
|
230
236
|
- test/new_relic/agent/stats_engine/metric_stats_test.rb
|
231
237
|
- test/new_relic/agent/stats_engine/samplers_test.rb
|
232
238
|
- test/new_relic/agent/stats_engine_test.rb
|
239
|
+
- test/new_relic/agent/transaction_info_test.rb
|
233
240
|
- test/new_relic/agent/transaction_sample_builder_test.rb
|
234
241
|
- test/new_relic/agent/transaction_sampler_test.rb
|
235
242
|
- test/new_relic/agent/worker_loop_test.rb
|
243
|
+
- test/new_relic/agent_test.rb
|
236
244
|
- test/new_relic/collection_helper_test.rb
|
237
245
|
- test/new_relic/command/deployments_test.rb
|
238
246
|
- test/new_relic/control/class_methods_test.rb
|
247
|
+
- test/new_relic/control/configuration_test.rb
|
239
248
|
- test/new_relic/control/logging_methods_test.rb
|
240
249
|
- test/new_relic/control_test.rb
|
241
|
-
- test/new_relic/
|
250
|
+
- test/new_relic/delayed_job_injection_test.rb
|
251
|
+
- test/new_relic/fake_collector.rb
|
252
|
+
- test/new_relic/fake_service.rb
|
242
253
|
- test/new_relic/local_environment_test.rb
|
243
254
|
- test/new_relic/metric_data_test.rb
|
255
|
+
- test/new_relic/metric_parser/metric_parser_test.rb
|
244
256
|
- test/new_relic/metric_spec_test.rb
|
245
257
|
- test/new_relic/rack/all_test.rb
|
246
258
|
- test/new_relic/rack/browser_monitoring_test.rb
|
259
|
+
- test/new_relic/rack/developer_mode_helper_test.rb
|
247
260
|
- test/new_relic/rack/developer_mode_test.rb
|
248
261
|
- test/new_relic/stats_test.rb
|
249
262
|
- test/new_relic/transaction_analysis/segment_summary_test.rb
|
@@ -255,6 +268,11 @@ files:
|
|
255
268
|
- test/new_relic/transaction_sample_subtest_test.rb
|
256
269
|
- test/new_relic/transaction_sample_test.rb
|
257
270
|
- test/new_relic/version_number_test.rb
|
271
|
+
- test/script/build_test_gem.sh
|
272
|
+
- test/script/ci.sh
|
273
|
+
- test/script/ci_agent-tests_runner.sh
|
274
|
+
- test/script/ci_bench.sh
|
275
|
+
- test/script/ci_multiverse_runner.sh
|
258
276
|
- test/test_contexts.rb
|
259
277
|
- test/test_helper.rb
|
260
278
|
- ui/helpers/developer_mode_helper.rb
|
@@ -289,11 +307,8 @@ files:
|
|
289
307
|
- ui/views/newrelic/show_source.rhtml
|
290
308
|
- ui/views/newrelic/threads.rhtml
|
291
309
|
- vendor/gems/dependency_detection-0.0.1.build/LICENSE
|
292
|
-
- vendor/gems/dependency_detection-0.0.1.build/README
|
293
310
|
- vendor/gems/dependency_detection-0.0.1.build/lib/dependency_detection.rb
|
294
311
|
- vendor/gems/dependency_detection-0.0.1.build/lib/dependency_detection/version.rb
|
295
|
-
- vendor/gems/metric_parser-0.1.0.pre1/LICENSE
|
296
|
-
- vendor/gems/metric_parser-0.1.0.pre1/README
|
297
312
|
- vendor/gems/metric_parser-0.1.0.pre1/lib/metric_parser.rb
|
298
313
|
- vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser.rb
|
299
314
|
- vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/action_mailer.rb
|
@@ -360,10 +375,11 @@ post_install_message: |
|
|
360
375
|
|
361
376
|
Please see http://github.com/newrelic/rpm/blob/master/CHANGELOG
|
362
377
|
for a complete description of the features and enhancements available
|
363
|
-
in version 3.
|
378
|
+
in version 3.4 of the Ruby Agent.
|
364
379
|
|
365
380
|
|
366
381
|
rdoc_options:
|
382
|
+
- --charset=UTF-8
|
367
383
|
- --line-numbers
|
368
384
|
- --inline-source
|
369
385
|
- --title
|
@@ -371,27 +387,25 @@ rdoc_options:
|
|
371
387
|
require_paths:
|
372
388
|
- lib
|
373
389
|
required_ruby_version: !ruby/object:Gem::Requirement
|
374
|
-
none: false
|
375
390
|
requirements:
|
376
391
|
- - ">="
|
377
392
|
- !ruby/object:Gem::Version
|
378
|
-
hash: 3
|
379
393
|
segments:
|
380
394
|
- 0
|
381
395
|
version: "0"
|
382
396
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
383
|
-
none: false
|
384
397
|
requirements:
|
385
|
-
- - "
|
398
|
+
- - ">"
|
386
399
|
- !ruby/object:Gem::Version
|
387
|
-
hash: 3
|
388
400
|
segments:
|
389
|
-
-
|
390
|
-
|
401
|
+
- 1
|
402
|
+
- 3
|
403
|
+
- 1
|
404
|
+
version: 1.3.1
|
391
405
|
requirements: []
|
392
406
|
|
393
407
|
rubyforge_project:
|
394
|
-
rubygems_version: 1.
|
408
|
+
rubygems_version: 1.3.6
|
395
409
|
signing_key:
|
396
410
|
specification_version: 3
|
397
411
|
summary: New Relic Ruby Agent
|
@@ -1,108 +0,0 @@
|
|
1
|
-
module NewRelic
|
2
|
-
module Agent
|
3
|
-
module Instrumentation
|
4
|
-
module ActiveRecordInstrumentation
|
5
|
-
|
6
|
-
def self.included(instrumented_class)
|
7
|
-
instrumented_class.class_eval do
|
8
|
-
alias_method :log_without_newrelic_instrumentation, :log
|
9
|
-
alias_method :log, :log_with_newrelic_instrumentation
|
10
|
-
protected :log
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
def log_with_newrelic_instrumentation(sql, name, &block)
|
15
|
-
|
16
|
-
return log_without_newrelic_instrumentation(sql, name, &block) unless NewRelic::Agent.is_execution_traced?
|
17
|
-
|
18
|
-
# Capture db config if we are going to try to get the explain plans
|
19
|
-
if (defined?(ActiveRecord::ConnectionAdapters::MysqlAdapter) && self.is_a?(ActiveRecord::ConnectionAdapters::MysqlAdapter)) ||
|
20
|
-
(defined?(ActiveRecord::ConnectionAdapters::Mysql2Adapter) && self.is_a?(ActiveRecord::ConnectionAdapters::Mysql2Adapter)) ||
|
21
|
-
(defined?(ActiveRecord::ConnectionAdapters::PostgreSQLAdapter) && self.is_a?(ActiveRecord::ConnectionAdapters::PostgreSQLAdapter))
|
22
|
-
supported_config = @config
|
23
|
-
end
|
24
|
-
if name && (parts = name.split " ") && parts.size == 2
|
25
|
-
model = parts.first
|
26
|
-
operation = parts.last.downcase
|
27
|
-
metric_name = case operation
|
28
|
-
when 'load' then 'find'
|
29
|
-
when 'indexes', 'columns' then nil # fall back to DirectSQL
|
30
|
-
when 'destroy', 'find', 'save', 'create' then operation
|
31
|
-
when 'update' then 'save'
|
32
|
-
else
|
33
|
-
if model == 'Join'
|
34
|
-
operation
|
35
|
-
end
|
36
|
-
end
|
37
|
-
metric = "ActiveRecord/#{model}/#{metric_name}" if metric_name
|
38
|
-
end
|
39
|
-
|
40
|
-
if metric.nil?
|
41
|
-
metric = NewRelic::Agent::Instrumentation::MetricFrame.database_metric_name
|
42
|
-
if metric.nil?
|
43
|
-
if sql =~ /^(select|update|insert|delete|show)/i
|
44
|
-
# Could not determine the model/operation so let's find a better
|
45
|
-
# metric. If it doesn't match the regex, it's probably a show
|
46
|
-
# command or some DDL which we'll ignore.
|
47
|
-
metric = "Database/SQL/#{$1.downcase}"
|
48
|
-
else
|
49
|
-
metric = "Database/SQL/other"
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
if !metric
|
55
|
-
log_without_newrelic_instrumentation(sql, name, &block)
|
56
|
-
else
|
57
|
-
metrics = [metric, "ActiveRecord/all"]
|
58
|
-
metrics << "ActiveRecord/#{metric_name}" if metric_name
|
59
|
-
self.class.trace_execution_scoped(metrics) do
|
60
|
-
t0 = Time.now
|
61
|
-
begin
|
62
|
-
log_without_newrelic_instrumentation(sql, name, &block)
|
63
|
-
ensure
|
64
|
-
NewRelic::Agent.instance.transaction_sampler.notice_sql(sql, supported_config, (Time.now - t0).to_f)
|
65
|
-
end
|
66
|
-
end
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
|
-
end
|
71
|
-
end
|
72
|
-
end
|
73
|
-
end
|
74
|
-
|
75
|
-
DependencyDetection.defer do
|
76
|
-
depends_on do
|
77
|
-
defined?(ActiveRecord) && defined?(ActiveRecord::Base)
|
78
|
-
end
|
79
|
-
|
80
|
-
depends_on do
|
81
|
-
defined?(Rails) && Rails::VERSION::MAJOR.to_i == 2
|
82
|
-
end
|
83
|
-
|
84
|
-
depends_on do
|
85
|
-
!NewRelic::Control.instance['skip_ar_instrumentation']
|
86
|
-
end
|
87
|
-
|
88
|
-
depends_on do
|
89
|
-
!NewRelic::Control.instance['disable_activerecord_instrumentation']
|
90
|
-
end
|
91
|
-
|
92
|
-
executes do
|
93
|
-
ActiveRecord::ConnectionAdapters::AbstractAdapter.module_eval do
|
94
|
-
include ::NewRelic::Agent::Instrumentation::ActiveRecordInstrumentation
|
95
|
-
end
|
96
|
-
end
|
97
|
-
|
98
|
-
executes do
|
99
|
-
ActiveRecord::Base.class_eval do
|
100
|
-
class << self
|
101
|
-
add_method_tracer :find_by_sql, 'ActiveRecord/#{self.name}/find_by_sql', :metric => false
|
102
|
-
add_method_tracer :transaction, 'ActiveRecord/#{self.name}/transaction', :metric => false
|
103
|
-
end
|
104
|
-
end
|
105
|
-
end
|
106
|
-
end
|
107
|
-
|
108
|
-
DependencyDetection.detect!
|
@@ -1,112 +0,0 @@
|
|
1
|
-
module NewRelic
|
2
|
-
module Agent
|
3
|
-
module Instrumentation
|
4
|
-
module ActiveRecordInstrumentation
|
5
|
-
|
6
|
-
def self.included(instrumented_class)
|
7
|
-
instrumented_class.class_eval do
|
8
|
-
unless instrumented_class.method_defined?(:log_without_newrelic_instrumentation)
|
9
|
-
alias_method :log_without_newrelic_instrumentation, :log
|
10
|
-
alias_method :log, :log_with_newrelic_instrumentation
|
11
|
-
protected :log
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
def log_with_newrelic_instrumentation(sql, name, &block)
|
17
|
-
|
18
|
-
return log_without_newrelic_instrumentation(sql, name, &block) unless NewRelic::Agent.is_execution_traced?
|
19
|
-
|
20
|
-
# Capture db config if we are going to try to get the explain plans
|
21
|
-
if (defined?(ActiveRecord::ConnectionAdapters::MysqlAdapter) && self.is_a?(ActiveRecord::ConnectionAdapters::MysqlAdapter)) ||
|
22
|
-
(defined?(ActiveRecord::ConnectionAdapters::Mysql2Adapter) && self.is_a?(ActiveRecord::ConnectionAdapters::Mysql2Adapter)) ||
|
23
|
-
(defined?(ActiveRecord::ConnectionAdapters::PostgreSQLAdapter) && self.is_a?(ActiveRecord::ConnectionAdapters::PostgreSQLAdapter))
|
24
|
-
supported_config = @config
|
25
|
-
end
|
26
|
-
if name && (parts = name.split " ") && parts.size == 2
|
27
|
-
model = parts.first
|
28
|
-
operation = parts.last.downcase
|
29
|
-
metric_name = case operation
|
30
|
-
when 'load' then 'find'
|
31
|
-
when 'indexes', 'columns' then nil # fall back to DirectSQL
|
32
|
-
when 'destroy', 'find', 'save', 'create' then operation
|
33
|
-
when 'update' then 'save'
|
34
|
-
else
|
35
|
-
if model == 'Join'
|
36
|
-
operation
|
37
|
-
end
|
38
|
-
end
|
39
|
-
metric = "ActiveRecord/#{model}/#{metric_name}" if metric_name
|
40
|
-
end
|
41
|
-
|
42
|
-
if metric.nil?
|
43
|
-
metric = NewRelic::Agent::Instrumentation::MetricFrame.database_metric_name
|
44
|
-
if metric.nil?
|
45
|
-
if sql =~ /^(select|update|insert|delete|show)/i
|
46
|
-
# Could not determine the model/operation so let's find a better
|
47
|
-
# metric. If it doesn't match the regex, it's probably a show
|
48
|
-
# command or some DDL which we'll ignore.
|
49
|
-
metric = "Database/SQL/#{$1.downcase}"
|
50
|
-
else
|
51
|
-
metric = "Database/SQL/other"
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
if !metric
|
57
|
-
log_without_newrelic_instrumentation(sql, name, &block)
|
58
|
-
else
|
59
|
-
metrics = [metric, "ActiveRecord/all"]
|
60
|
-
metrics << "ActiveRecord/#{metric_name}" if metric_name
|
61
|
-
self.class.trace_execution_scoped(metrics) do
|
62
|
-
t0 = Time.now
|
63
|
-
begin
|
64
|
-
log_without_newrelic_instrumentation(sql, name, &block)
|
65
|
-
ensure
|
66
|
-
NewRelic::Agent.instance.transaction_sampler.notice_sql(sql, supported_config, (Time.now - t0).to_f)
|
67
|
-
end
|
68
|
-
end
|
69
|
-
end
|
70
|
-
end
|
71
|
-
|
72
|
-
end
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|
76
|
-
|
77
|
-
DependencyDetection.defer do
|
78
|
-
depends_on do
|
79
|
-
defined?(ActiveRecord) && defined?(ActiveRecord::Base)
|
80
|
-
end
|
81
|
-
|
82
|
-
depends_on do
|
83
|
-
defined?(Rails) && Rails::VERSION::MAJOR.to_i == 3
|
84
|
-
end
|
85
|
-
|
86
|
-
depends_on do
|
87
|
-
!NewRelic::Control.instance['skip_ar_instrumentation']
|
88
|
-
end
|
89
|
-
|
90
|
-
depends_on do
|
91
|
-
!NewRelic::Control.instance['disable_activerecord_instrumentation']
|
92
|
-
end
|
93
|
-
|
94
|
-
executes do
|
95
|
-
Rails.configuration.after_initialize do
|
96
|
-
ActiveRecord::ConnectionAdapters::AbstractAdapter.module_eval do
|
97
|
-
include ::NewRelic::Agent::Instrumentation::ActiveRecordInstrumentation
|
98
|
-
end
|
99
|
-
end
|
100
|
-
end
|
101
|
-
|
102
|
-
executes do
|
103
|
-
Rails.configuration.after_initialize do
|
104
|
-
ActiveRecord::Base.class_eval do
|
105
|
-
class << self
|
106
|
-
add_method_tracer :find_by_sql, 'ActiveRecord/#{self.name}/find_by_sql', :metric => false
|
107
|
-
add_method_tracer :transaction, 'ActiveRecord/#{self.name}/transaction', :metric => false
|
108
|
-
end
|
109
|
-
end
|
110
|
-
end
|
111
|
-
end
|
112
|
-
end
|