newrelic_rpm 2.13.2 → 2.13.3.beta

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.

Files changed (92) hide show
  1. data/CHANGELOG +18 -0
  2. data/LICENSE +1 -1
  3. data/README.rdoc +10 -5
  4. data/lib/conditional_vendored_metric_parser.rb +5 -0
  5. data/lib/new_relic/agent.rb +0 -1
  6. data/lib/new_relic/agent/agent.rb +1 -1
  7. data/lib/new_relic/agent/error_collector.rb +2 -0
  8. data/lib/new_relic/agent/instrumentation/data_mapper.rb +170 -47
  9. data/lib/new_relic/agent/instrumentation/memcache.rb +3 -1
  10. data/lib/new_relic/agent/instrumentation/metric_frame.rb +1 -1
  11. data/lib/new_relic/agent/instrumentation/rails3/action_controller.rb +6 -0
  12. data/lib/new_relic/agent/instrumentation/sinatra.rb +4 -3
  13. data/lib/new_relic/agent/stats_engine/metric_stats.rb +134 -98
  14. data/lib/new_relic/commands/install.rb +10 -0
  15. data/lib/new_relic/control.rb +13 -0
  16. data/lib/new_relic/control/configuration.rb +1 -1
  17. data/lib/new_relic/control/frameworks/rails.rb +9 -5
  18. data/lib/new_relic/control/frameworks/rails3.rb +3 -7
  19. data/lib/new_relic/control/instrumentation.rb +2 -2
  20. data/lib/new_relic/delayed_job_injection.rb +1 -1
  21. data/lib/new_relic/rack/developer_mode.rb +1 -1
  22. data/lib/new_relic/recipes.rb +1 -1
  23. data/lib/new_relic/transaction_analysis.rb +1 -1
  24. data/lib/new_relic/transaction_sample.rb +3 -1
  25. data/lib/new_relic/version.rb +2 -2
  26. data/newrelic_rpm.gemspec +50 -19
  27. data/test/new_relic/agent/memcache_instrumentation_test.rb +29 -25
  28. data/ui/helpers/developer_mode_helper.rb +1 -11
  29. data/ui/views/newrelic/_segment.rhtml +0 -1
  30. data/ui/views/newrelic/_segment_row.rhtml +1 -3
  31. data/ui/views/newrelic/index.rhtml +12 -0
  32. data/ui/views/newrelic/threads.rhtml +8 -7
  33. data/vendor/gems/metric_parser-0.1.0.pre1/LICENSE +0 -0
  34. data/vendor/gems/metric_parser-0.1.0.pre1/README +0 -0
  35. data/vendor/gems/metric_parser-0.1.0.pre1/lib/metric_parser.rb +1 -0
  36. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser.rb +64 -0
  37. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/action_mailer.rb +14 -0
  38. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/active_merchant.rb +31 -0
  39. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/active_record.rb +33 -0
  40. data/{lib → vendor/gems/metric_parser-0.1.0.pre1/lib}/new_relic/metric_parser/apdex.rb +12 -11
  41. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/background_transaction.rb +7 -0
  42. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/client.rb +46 -0
  43. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/controller.rb +67 -0
  44. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/controller_cpu.rb +43 -0
  45. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/controller_ext.rb +17 -0
  46. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/database.rb +48 -0
  47. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/database_pool.rb +24 -0
  48. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/dot_net.rb +28 -0
  49. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/dot_net_parser.rb +17 -0
  50. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/errors.rb +11 -0
  51. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/external.rb +55 -0
  52. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/frontend.rb +40 -0
  53. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/gc.rb +20 -0
  54. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/hibernate_session.rb +7 -0
  55. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/java.rb +31 -0
  56. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/java_parser.rb +17 -0
  57. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/jsp.rb +34 -0
  58. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/jsp_tag.rb +7 -0
  59. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/mem_cache.rb +55 -0
  60. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/metric_parser.rb +122 -0
  61. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/orm.rb +27 -0
  62. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/other_transaction.rb +40 -0
  63. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/servlet.rb +7 -0
  64. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/servlet_context_listener.rb +7 -0
  65. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/servlet_filter.rb +7 -0
  66. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/solr.rb +27 -0
  67. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/solr_request_handler.rb +15 -0
  68. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/spring.rb +54 -0
  69. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/spring_controller.rb +6 -0
  70. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/spring_view.rb +6 -0
  71. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/struts_action.rb +20 -0
  72. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/struts_result.rb +20 -0
  73. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/version.rb +5 -0
  74. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/view.rb +66 -0
  75. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/web_frontend.rb +18 -0
  76. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/web_service.rb +14 -0
  77. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/web_transaction.rb +133 -0
  78. metadata +88 -39
  79. data/lib/new_relic/metric_parser.rb +0 -136
  80. data/lib/new_relic/metric_parser/action_mailer.rb +0 -9
  81. data/lib/new_relic/metric_parser/active_merchant.rb +0 -26
  82. data/lib/new_relic/metric_parser/active_record.rb +0 -28
  83. data/lib/new_relic/metric_parser/controller.rb +0 -62
  84. data/lib/new_relic/metric_parser/controller_cpu.rb +0 -38
  85. data/lib/new_relic/metric_parser/errors.rb +0 -6
  86. data/lib/new_relic/metric_parser/external.rb +0 -50
  87. data/lib/new_relic/metric_parser/mem_cache.rb +0 -50
  88. data/lib/new_relic/metric_parser/other_transaction.rb +0 -36
  89. data/lib/new_relic/metric_parser/view.rb +0 -61
  90. data/lib/new_relic/metric_parser/web_frontend.rb +0 -14
  91. data/lib/new_relic/metric_parser/web_service.rb +0 -9
  92. data/test/new_relic/metric_parser_test.rb +0 -226
@@ -56,7 +56,17 @@ you receive upon registration.
56
56
  E-mail support@newrelic.com with any problems or questions.
57
57
 
58
58
  EOF
59
+ puts <<-EOF
59
60
 
61
+ Installing the plugin from Rubyforge is deprecated. This repository will not be updated after January 2011
62
+
63
+ Please use one of the following options:
64
+
65
+ Gems: gem install newrelic_rpm
66
+
67
+ Github! git clone git://github.com/newrelic/rpm.git vendor/plugins/newrelic_rpm
68
+
69
+ EOF
60
70
  end
61
71
 
62
72
  def content
@@ -93,6 +93,8 @@ module NewRelic
93
93
  # is called one or more times.
94
94
  #
95
95
  def init_plugin(options={})
96
+ require 'conditional_vendored_metric_parser'
97
+
96
98
  options['app_name'] = ENV['NEWRELIC_APP_NAME'] if ENV['NEWRELIC_APP_NAME']
97
99
 
98
100
  require 'new_relic/agent'
@@ -171,6 +173,17 @@ module NewRelic
171
173
  # the server for change detection. Override in subclasses
172
174
  def append_environment_info; end
173
175
 
176
+ def bundler_gem_list
177
+ if defined?(Bundler) && Bundler.instance_eval do @load end
178
+ Bundler.load.specs.map do | spec |
179
+ version = (spec.respond_to?(:version) && spec.version)
180
+ spec.name + (version ? "(#{version})" : "")
181
+ end
182
+ else
183
+ []
184
+ end
185
+ end
186
+
174
187
  def config_file
175
188
  File.expand_path(File.join(root,"config","newrelic.yml"))
176
189
  end
@@ -23,7 +23,7 @@ module NewRelic
23
23
  'host' => 'collector.newrelic.com',
24
24
  'ssl' => false,
25
25
  'log_level' => 'info',
26
- 'apdex_t' => 1.0
26
+ 'apdex_t' => 0.5
27
27
  }
28
28
  s.merge! settings_hash if settings_hash
29
29
  # monitor_daemons replaced with agent_enabled
@@ -84,6 +84,14 @@ class NewRelic::Control::Frameworks::Rails < NewRelic::Control
84
84
  File.join(root,'vendor','rails')
85
85
  end
86
86
 
87
+ def rails_gem_list
88
+ ::Rails.configuration.gems.map do | gem |
89
+ version = (gem.respond_to?(:version) && gem.version) ||
90
+ (gem.specification.respond_to?(:version) && gem.specification.version)
91
+ gem.name + (version ? "(#{version})" : "")
92
+ end
93
+ end
94
+
87
95
  # Collect the Rails::Info into an associative array as well as the list of plugins
88
96
  def append_environment_info
89
97
  local_env.append_environment_value('Rails version'){ ::Rails::VERSION::STRING }
@@ -95,11 +103,7 @@ class NewRelic::Control::Frameworks::Rails < NewRelic::Control
95
103
  local_env.append_environment_value('Rails Env') { ENV['RAILS_ENV'] }
96
104
  if rails_version >= NewRelic::VersionNumber.new('2.1.0')
97
105
  local_env.append_gem_list do
98
- ::Rails.configuration.gems.map do | gem |
99
- version = (gem.respond_to?(:version) && gem.version) ||
100
- (gem.specification.respond_to?(:version) && gem.specification.version)
101
- gem.name + (version ? "(#{version})" : "")
102
- end
106
+ (bundler_gem_list + rails_gem_list).uniq
103
107
  end
104
108
  # The plugins is configured manually. If it's nil, it loads everything non-deterministically
105
109
  if ::Rails.configuration.plugins
@@ -44,17 +44,13 @@ class NewRelic::Control::Frameworks::Rails3 < NewRelic::Control::Frameworks::Rai
44
44
  def append_environment_info
45
45
  local_env.append_environment_value('Rails version'){ version }
46
46
  local_env.append_environment_value('Rails threadsafe') do
47
- ::Rails.configuration.action_controller.allow_concurrency == true
47
+ true == ::Rails.configuration.action_controller.allow_concurrency
48
48
  end
49
49
  local_env.append_environment_value('Rails Env') { env }
50
50
  local_env.append_gem_list do
51
- ::Rails.configuration.gems.map do | gem |
52
- version = (gem.respond_to?(:version) && gem.version) ||
53
- (gem.specification.respond_to?(:version) && gem.specification.version)
54
- gem.name + (version ? "(#{version})" : "")
55
- end
51
+ bundler_gem_list
56
52
  end
57
- local_env.append_plugin_list { ::Rails.configuration.plugins }
53
+ local_env.append_plugin_list { ::Rails.configuration.plugins.to_a }
58
54
  end
59
55
 
60
56
  end
@@ -5,7 +5,7 @@ module NewRelic
5
5
  Dir.glob(pattern) do |file|
6
6
  begin
7
7
  log.debug "Processing instrumentation file '#{file}'"
8
- require file
8
+ require file.to_s
9
9
  rescue => e
10
10
  log.error "Error loading instrumentation file '#{file}': #{e}"
11
11
  log.debug e.backtrace.join("\n")
@@ -83,7 +83,7 @@ module NewRelic
83
83
 
84
84
  # Instrumentation for the key code points inside rails for monitoring by NewRelic.
85
85
  # note this file is loaded only if the newrelic agent is enabled (through config/newrelic.yml)
86
- instrumentation_path = File.join(File.dirname(__FILE__), '..', 'agent','instrumentation')
86
+ instrumentation_path = File.expand_path(File.join(File.dirname(__FILE__), '..', 'agent','instrumentation'))
87
87
  @instrumentation_files <<
88
88
  File.join(instrumentation_path, '*.rb') <<
89
89
  File.join(instrumentation_path, app.to_s, '*.rb')
@@ -19,7 +19,7 @@ Delayed::Worker.class_eval do
19
19
  dispatcher_instance_id = worker_name || "host:#{Socket.gethostname} pid:#{Process.pid}" rescue "pid:#{Process.pid}"
20
20
  say "RPM Monitoring DJ worker #{dispatcher_instance_id}"
21
21
  NewRelic::DelayedJobInjection.worker_name = worker_name
22
- NewRelic::Agent.manual_start :dispatcher => :delayed_job, :dispatcher_instance_id => dispatcher_instance_id
22
+ NewRelic::Control.instance.init_plugin :dispatcher => :delayed_job, :dispatcher_instance_id => dispatcher_instance_id
23
23
  end
24
24
 
25
25
  alias initialize_without_new_relic initialize
@@ -216,7 +216,7 @@ class DeveloperMode
216
216
 
217
217
  controller_metric = @sample.root_segment.called_segments.first.metric_name
218
218
 
219
- metric_parser = NewRelic::MetricParser.for_metric_named controller_metric
219
+ metric_parser = NewRelic::MetricParser::MetricParser.for_metric_named controller_metric
220
220
  @sample_controller_name = metric_parser.controller_name
221
221
  @sample_action_name = metric_parser.action_name
222
222
 
@@ -8,7 +8,7 @@
8
8
  # The task will run on app servers except where no_release is true.
9
9
  # If it fails, it will not affect the task execution or do a rollback.
10
10
  #
11
- make_notify_task = lambda do
11
+ make_notify_task = Proc.new do
12
12
 
13
13
  namespace :newrelic do
14
14
 
@@ -49,7 +49,7 @@ module TransactionAnalysis
49
49
 
50
50
  def developer_name
51
51
  return @metric_name if @metric_name == 'Remainder'
52
- NewRelic::MetricParser.parse(@metric_name).developer_name
52
+ NewRelic::MetricParser::MetricParser.parse(@metric_name).developer_name
53
53
  end
54
54
  end
55
55
 
@@ -202,8 +202,10 @@ module NewRelic
202
202
  # Note: have to convert from native column element types to string so we can
203
203
  # serialize. Esp. for postgresql.
204
204
  # Can't use map. Suck it up.
205
+ # Can too use map. Lrn2prgm
205
206
  if explain_resultset.respond_to?(:each)
206
- explain_resultset.each { | row | rows << row.map(&:to_s) }
207
+ explain_resultset.extend Enumerable unless explain_resultset.respond_to?(:map)
208
+ rows = explain_resultset.map { | row | row.map(&:to_s) }
207
209
  else
208
210
  rows << [ explain_resultset ]
209
211
  end
@@ -3,8 +3,8 @@ module NewRelic
3
3
  module VERSION #:nodoc:
4
4
  MAJOR = 2
5
5
  MINOR = 13
6
- TINY = 2
7
- BUILD = nil #'0' # Set to nil for a release, 'beta1', 'alpha', etc for prerelease builds
6
+ TINY = 3
7
+ BUILD = 'beta' #'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
 
@@ -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.2"
8
+ s.version = "2.13.3.beta"
9
9
 
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
10
+ s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Bill Kayser", "Justin George"]
12
- s.date = %q{2010-10-04}
12
+ s.date = %q{2010-10-28}
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
@@ -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_metric_parser.rb",
37
38
  "lib/new_relic/agent.rb",
38
39
  "lib/new_relic/agent/agent.rb",
39
40
  "lib/new_relic/agent/busy_calculator.rb",
@@ -95,20 +96,6 @@ http://github.com/newrelic/rpm/tree/master.
95
96
  "lib/new_relic/local_environment.rb",
96
97
  "lib/new_relic/merbtasks.rb",
97
98
  "lib/new_relic/metric_data.rb",
98
- "lib/new_relic/metric_parser.rb",
99
- "lib/new_relic/metric_parser/action_mailer.rb",
100
- "lib/new_relic/metric_parser/active_merchant.rb",
101
- "lib/new_relic/metric_parser/active_record.rb",
102
- "lib/new_relic/metric_parser/apdex.rb",
103
- "lib/new_relic/metric_parser/controller.rb",
104
- "lib/new_relic/metric_parser/controller_cpu.rb",
105
- "lib/new_relic/metric_parser/errors.rb",
106
- "lib/new_relic/metric_parser/external.rb",
107
- "lib/new_relic/metric_parser/mem_cache.rb",
108
- "lib/new_relic/metric_parser/other_transaction.rb",
109
- "lib/new_relic/metric_parser/view.rb",
110
- "lib/new_relic/metric_parser/web_frontend.rb",
111
- "lib/new_relic/metric_parser/web_service.rb",
112
99
  "lib/new_relic/metric_spec.rb",
113
100
  "lib/new_relic/metrics.rb",
114
101
  "lib/new_relic/noticed_error.rb",
@@ -160,7 +147,6 @@ http://github.com/newrelic/rpm/tree/master.
160
147
  "test/new_relic/control_test.rb",
161
148
  "test/new_relic/deployments_api_test.rb",
162
149
  "test/new_relic/environment_test.rb",
163
- "test/new_relic/metric_parser_test.rb",
164
150
  "test/new_relic/metric_spec_test.rb",
165
151
  "test/new_relic/rack/episodes_test.rb",
166
152
  "test/new_relic/shim_agent_test.rb",
@@ -198,7 +184,52 @@ http://github.com/newrelic/rpm/tree/master.
198
184
  "ui/views/newrelic/sample_not_found.rhtml",
199
185
  "ui/views/newrelic/show_sample.rhtml",
200
186
  "ui/views/newrelic/show_source.rhtml",
201
- "ui/views/newrelic/threads.rhtml"
187
+ "ui/views/newrelic/threads.rhtml",
188
+ "vendor/gems/metric_parser-0.1.0.pre1/LICENSE",
189
+ "vendor/gems/metric_parser-0.1.0.pre1/README",
190
+ "vendor/gems/metric_parser-0.1.0.pre1/lib/metric_parser.rb",
191
+ "vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser.rb",
192
+ "vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/action_mailer.rb",
193
+ "vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/active_merchant.rb",
194
+ "vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/active_record.rb",
195
+ "vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/apdex.rb",
196
+ "vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/background_transaction.rb",
197
+ "vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/client.rb",
198
+ "vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/controller.rb",
199
+ "vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/controller_cpu.rb",
200
+ "vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/controller_ext.rb",
201
+ "vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/database.rb",
202
+ "vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/database_pool.rb",
203
+ "vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/dot_net.rb",
204
+ "vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/dot_net_parser.rb",
205
+ "vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/errors.rb",
206
+ "vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/external.rb",
207
+ "vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/frontend.rb",
208
+ "vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/gc.rb",
209
+ "vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/hibernate_session.rb",
210
+ "vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/java.rb",
211
+ "vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/java_parser.rb",
212
+ "vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/jsp.rb",
213
+ "vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/jsp_tag.rb",
214
+ "vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/mem_cache.rb",
215
+ "vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/metric_parser.rb",
216
+ "vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/orm.rb",
217
+ "vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/other_transaction.rb",
218
+ "vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/servlet.rb",
219
+ "vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/servlet_context_listener.rb",
220
+ "vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/servlet_filter.rb",
221
+ "vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/solr.rb",
222
+ "vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/solr_request_handler.rb",
223
+ "vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/spring.rb",
224
+ "vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/spring_controller.rb",
225
+ "vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/spring_view.rb",
226
+ "vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/struts_action.rb",
227
+ "vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/struts_result.rb",
228
+ "vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/version.rb",
229
+ "vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/view.rb",
230
+ "vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/web_frontend.rb",
231
+ "vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/web_service.rb",
232
+ "vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/web_transaction.rb"
202
233
  ]
203
234
  s.homepage = %q{http://www.github.com/newrelic/rpm}
204
235
  s.post_install_message = %q{
@@ -1,45 +1,49 @@
1
1
  require File.expand_path(File.join(File.dirname(__FILE__),'..','..','test_helper'))
2
2
 
3
+ memcached_ready = false
4
+ classes = {
5
+ 'memcache' => 'MemCache',
6
+ 'dalli' => 'Dalli::Client',
7
+ }
8
+ begin
9
+ TCPSocket.new('localhost', 11211)
10
+ classes.each do |req, const|
11
+ begin
12
+ require req
13
+ MEMCACHED_CLASS = const.constantize
14
+ puts "Testing #{MEMCACHED_CLASS}"
15
+ memcached_ready = true
16
+ rescue LoadError
17
+ rescue NameError
18
+ end
19
+ end
20
+ rescue Errno::ECONNREFUSED
21
+ rescue Errno::ETIMEDOUT
22
+ end
23
+
3
24
  class NewRelic::Agent::MemcacheInstrumentationTest < Test::Unit::TestCase
4
25
  include NewRelic::Agent::Instrumentation::ControllerInstrumentation
5
-
6
- # This implementation: http://seattlerb.rubyforge.org/memcache-client/
7
- def using_memcache_client?
8
- ::MemCache.method_defined? :cache_get
9
- end
10
-
26
+
11
27
  def setup
12
28
  NewRelic::Agent.manual_start
13
29
  @engine = NewRelic::Agent.instance.stats_engine
14
30
 
15
- if using_memcache_client?
16
- @cache = ::MemCache.new('localhost')
17
- else
18
- server = ::MemCache::Server.new('localhost')
19
- @cache = ::MemCache.new(server)
20
- end
31
+ @cache = MEMCACHED_CLASS.new('localhost')
32
+ @cache.flush_all
21
33
  @key = 'schluessel'
22
34
  end
23
35
 
24
36
  def _call_test_method_in_web_transaction(method, *args)
25
37
  @engine.clear_stats
26
- begin
27
- perform_action_with_newrelic_trace(:name=>'action', :category => :controller) do
28
- @cache.send(method.to_sym, *[@key, *args])
29
- end
30
- rescue ::MemCache::MemCacheError
31
- # There's probably no memcached around
38
+ perform_action_with_newrelic_trace(:name=>'action', :category => :controller) do
39
+ @cache.send(method.to_sym, *[@key, *args])
32
40
  end
33
41
  end
34
42
 
35
43
  def _call_test_method_in_background_task(method, *args)
36
44
  @engine.clear_stats
37
- begin
38
- perform_action_with_newrelic_trace(:name => 'bg_task', :category => :task) do
39
- @cache.send(method.to_sym, *[@key, *args])
40
- end
41
- rescue ::MemCache::MemCacheError
42
- # There's probably no memcached around
45
+ perform_action_with_newrelic_trace(:name => 'bg_task', :category => :task) do
46
+ @cache.send(method.to_sym, *[@key, *args])
43
47
  end
44
48
  end
45
49
 
@@ -100,4 +104,4 @@ class NewRelic::Agent::MemcacheInstrumentationTest < Test::Unit::TestCase
100
104
  end
101
105
  end
102
106
 
103
- end if defined? MemCache
107
+ end if memcached_ready
@@ -5,12 +5,6 @@ module NewRelic::DeveloperModeHelper
5
5
 
6
6
  private
7
7
 
8
- # return the host that serves static content (css, metric documentation, images, etc)
9
- # that supports the desktop edition.
10
- def server
11
- NewRelic::Control.instance['desktop_server'] || "http://rpm.newrelic.com"
12
- end
13
-
14
8
  # limit of how many detail/SQL rows we display - very large data sets (~10000+) crash browsers
15
9
  def trace_row_display_limit
16
10
  2000
@@ -62,10 +56,6 @@ module NewRelic::DeveloperModeHelper
62
56
  path
63
57
  end
64
58
 
65
- def url_for_metric_doc(metric_name)
66
- "#{server}/metric_doc?metric=#{CGI::escape(metric_name)}"
67
- end
68
-
69
59
  def url_for_source(trace_line)
70
60
  file, line = file_and_line(trace_line)
71
61
 
@@ -87,7 +77,7 @@ module NewRelic::DeveloperModeHelper
87
77
  end
88
78
 
89
79
  def dev_name(metric_name)
90
- NewRelic::MetricParser.parse(metric_name).developer_name
80
+ NewRelic::MetricParser::MetricParser.parse(metric_name).developer_name
91
81
  end
92
82
 
93
83
  # write the metric label for a segment metric in the detail view
@@ -7,7 +7,6 @@
7
7
  <%= expand_segment_image(segment, indent) %>
8
8
  </div>
9
9
  <%= write_segment_label segment%>
10
- <small><%= link_to '?', url_for_metric_doc(segment.metric_name)%></small>
11
10
  </div>
12
11
  </td>
13
12
 
@@ -1,9 +1,7 @@
1
1
  <tr class='<%= cycle('even_row', 'odd_row') %>'>
2
2
  <td>
3
3
  <%= write_summary_segment_label object %>
4
- <small>
5
- <%= link_to "?", url_for_metric_doc(object.metric_name) %>
6
- </small>
4
+
7
5
  </td>
8
6
  <td align=left> <%= object.call_count %></td>
9
7
  <td align=right><%= with_delimiter(to_ms(object.exclusive_time)) %> ms</td>
@@ -21,6 +21,18 @@
21
21
  </table>
22
22
  </td>
23
23
  <td valign=top>
24
+ <% if defined?(Unicorn) || defined?(Passenger) %>
25
+ <div class="flash">
26
+ <p id="errorExplanation">
27
+ We've noticed you're running a forking web server, like Unicorn or Passenger. See Below</p><p> Developer mode may be unpredictable,
28
+ since those servers run many processes and developer mode is entirely in the process.</p><p> We suggest you try Thin,
29
+ Mongrel, or another single-process web server for development mode.</p><p>
30
+ (You can ignore this message if you're sure that you're running only one process, and it's not being reaped when inactive.)
31
+ </p>
32
+ </div>
33
+ <% end %>
34
+
35
+
24
36
  <%= link_to_if @samples.size > 0, "Clear Transactions (#{@samples.size})", 'reset' %><br/>
25
37
  <%= link_to "List Threads", 'threads' %><br/>
26
38
  <% if NewRelic::Control.instance.profiling_available? %>
@@ -1,5 +1,6 @@
1
+
1
2
  <h2>Thread List</h2>
2
- <p><%= link_to 'Back', :action => 'index' %></p>
3
+ <p><%= link_to 'Back', 'index' %></p>
3
4
  <table>
4
5
  <thead><th class="title" colspan="5">Application Threads</th></thead>
5
6
  <thead>
@@ -14,7 +15,7 @@
14
15
  threads = Thread.list - [ main ]
15
16
  nr_threads = []
16
17
  threads.delete_if { | thread | nr_threads << thread if thread.key? 'newrelic_label' }
17
- ([ main ] + threads).each_with_index do | thread, i | -%>
18
+ ([ main ] + threads).each_with_index do | thread, i | %>
18
19
  <tr class="odd_row">
19
20
  <td valign="top"><%= h(thread == main ? 'main' : thread.to_s) %></td>
20
21
  <td valign="top"><%= h(thread.status || 'terminated with exception') %></td>
@@ -24,8 +25,8 @@
24
25
  <%= thread.keys.map{|k| h k}.join("</br>") %>
25
26
  </td>
26
27
  </tr>
27
- <% end -%>
28
- <% if nr_threads.size > 0 -%>
28
+ <% end %>
29
+ <% if nr_threads.size > 0 %>
29
30
  <tr><td>&nbsp;</td></tr>
30
31
  <thead><th class="title" colspan="5">New Relic Agent Threads</th></thead>
31
32
  <thead>
@@ -36,7 +37,7 @@
36
37
  <th class="left">Locals</th>
37
38
  </thead>
38
39
 
39
- <% nr_threads.each_with_index do | thread, i | -%>
40
+ <% nr_threads.each_with_index do | thread, i | %>
40
41
  <tr class="odd_row">
41
42
  <td valign="top"><%= h thread['newrelic_label'] %></td>
42
43
  <td valign="top"><%= h(thread.status || 'terminated with exception') %></td>
@@ -46,7 +47,7 @@
46
47
  <%= (thread.keys - ['newrelic_label']).map{|k| h k}.join("</br>") %>
47
48
  </td>
48
49
  </tr>
49
- <% end -%>
50
- <% end -%>
50
+ <% end %>
51
+ <% end %>
51
52
 
52
53
  </table>