newrelic_rpm 2.14.1 → 3.0.0.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.

Files changed (123) hide show
  1. data/CHANGELOG +8 -0
  2. data/README.rdoc +2 -0
  3. data/install.rb +2 -2
  4. data/lib/new_relic/agent.rb +34 -1
  5. data/lib/new_relic/agent/agent.rb +34 -25
  6. data/lib/new_relic/agent/browser_monitoring.rb +111 -0
  7. data/lib/new_relic/agent/error_collector.rb +4 -4
  8. data/lib/new_relic/agent/instrumentation/acts_as_solr.rb +3 -3
  9. data/lib/new_relic/agent/instrumentation/controller_instrumentation.rb +5 -7
  10. data/lib/new_relic/agent/instrumentation/data_mapper.rb +8 -8
  11. data/lib/new_relic/agent/instrumentation/delayed_job_instrumentation.rb +1 -1
  12. data/lib/new_relic/agent/instrumentation/memcache.rb +1 -1
  13. data/lib/new_relic/agent/instrumentation/merb/controller.rb +1 -1
  14. data/lib/new_relic/agent/instrumentation/merb/errors.rb +1 -1
  15. data/lib/new_relic/agent/instrumentation/metric_frame.rb +1 -0
  16. data/lib/new_relic/agent/instrumentation/queue_time.rb +26 -26
  17. data/lib/new_relic/agent/instrumentation/rails/action_web_service.rb +1 -1
  18. data/lib/new_relic/agent/instrumentation/rails/errors.rb +1 -1
  19. data/lib/new_relic/agent/instrumentation/rails3/action_controller.rb +2 -2
  20. data/lib/new_relic/agent/instrumentation/sinatra.rb +1 -1
  21. data/lib/new_relic/agent/method_tracer.rb +15 -15
  22. data/lib/new_relic/agent/shim_agent.rb +2 -0
  23. data/lib/new_relic/agent/stats_engine/metric_stats.rb +3 -3
  24. data/lib/new_relic/agent/stats_engine/samplers.rb +2 -2
  25. data/lib/new_relic/agent/stats_engine/transactions.rb +2 -1
  26. data/lib/new_relic/agent/transaction_sample_builder.rb +101 -0
  27. data/lib/new_relic/agent/transaction_sampler.rb +299 -251
  28. data/lib/new_relic/control.rb +2 -2
  29. data/lib/new_relic/control/class_methods.rb +0 -5
  30. data/lib/new_relic/control/configuration.rb +4 -3
  31. data/lib/new_relic/control/frameworks/rails.rb +9 -12
  32. data/lib/new_relic/control/instance_methods.rb +2 -2
  33. data/lib/new_relic/control/instrumentation.rb +1 -1
  34. data/lib/new_relic/control/server_methods.rb +2 -2
  35. data/lib/new_relic/delayed_job_injection.rb +1 -1
  36. data/lib/new_relic/local_environment.rb +7 -7
  37. data/lib/new_relic/rack/browser_monitoring.rb +61 -0
  38. data/lib/new_relic/stats.rb +6 -6
  39. data/lib/new_relic/version.rb +4 -4
  40. data/newrelic.yml +19 -0
  41. data/newrelic_rpm.gemspec +9 -4
  42. data/test/active_record_fixtures.rb +5 -5
  43. data/test/config/test_control.rb +3 -3
  44. data/test/new_relic/agent/agent/connect_test.rb +27 -6
  45. data/test/new_relic/agent/agent/start_test.rb +13 -13
  46. data/test/new_relic/agent/agent/start_worker_thread_test.rb +8 -8
  47. data/test/new_relic/agent/agent_test.rb +85 -0
  48. data/test/new_relic/agent/agent_test_controller.rb +9 -9
  49. data/test/new_relic/agent/agent_test_controller_test.rb +37 -37
  50. data/test/new_relic/agent/browser_monitoring_test.rb +124 -0
  51. data/test/new_relic/agent/busy_calculator_test.rb +7 -7
  52. data/test/new_relic/agent/error_collector/notice_error_test.rb +9 -9
  53. data/test/new_relic/agent/error_collector_test.rb +54 -54
  54. data/test/new_relic/agent/instrumentation/active_record_instrumentation_test.rb +69 -69
  55. data/test/new_relic/agent/instrumentation/controller_instrumentation_test.rb +36 -0
  56. data/test/new_relic/agent/instrumentation/metric_frame_test.rb +3 -3
  57. data/test/new_relic/agent/instrumentation/net_instrumentation_test.rb +11 -11
  58. data/test/new_relic/agent/instrumentation/queue_time_test.rb +38 -35
  59. data/test/new_relic/agent/instrumentation/task_instrumentation_test.rb +18 -18
  60. data/test/new_relic/agent/memcache_instrumentation_test.rb +12 -12
  61. data/test/new_relic/agent/method_tracer/class_methods/add_method_tracer_test.rb +1 -1
  62. data/test/new_relic/agent/method_tracer/instance_methods/trace_execution_scoped_test.rb +16 -15
  63. data/test/new_relic/agent/method_tracer_test.rb +60 -60
  64. data/test/new_relic/agent/mock_scope_listener.rb +8 -8
  65. data/test/new_relic/agent/rpm_agent_test.rb +26 -26
  66. data/test/new_relic/agent/stats_engine/metric_stats_test.rb +17 -17
  67. data/test/new_relic/agent/stats_engine/samplers_test.rb +4 -4
  68. data/test/new_relic/agent/stats_engine/stats_engine_test.rb +51 -51
  69. data/test/new_relic/agent/transaction_sample_builder_test.rb +36 -36
  70. data/test/new_relic/agent/transaction_sampler_test.rb +727 -178
  71. data/test/new_relic/agent/worker_loop_test.rb +4 -4
  72. data/test/new_relic/collection_helper_test.rb +15 -15
  73. data/test/new_relic/command/deployments_test.rb +5 -5
  74. data/test/new_relic/control_test.rb +25 -25
  75. data/test/new_relic/local_environment_test.rb +11 -11
  76. data/test/new_relic/metric_spec_test.rb +21 -21
  77. data/test/new_relic/rack/episodes_test.rb +35 -35
  78. data/test/new_relic/stats_test.rb +61 -43
  79. data/test/new_relic/transaction_sample_subtest_test.rb +15 -15
  80. data/test/new_relic/transaction_sample_test.rb +25 -25
  81. data/test/new_relic/version_number_test.rb +11 -11
  82. data/test/test_contexts.rb +7 -7
  83. data/test/test_helper.rb +6 -6
  84. data/ui/helpers/developer_mode_helper.rb +67 -67
  85. data/ui/helpers/google_pie_chart.rb +4 -4
  86. data/vendor/gems/dependency_detection-0.0.1.build/lib/dependency_detection.rb +4 -4
  87. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/action_mailer.rb +3 -3
  88. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/active_merchant.rb +7 -7
  89. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/active_record.rb +1 -1
  90. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/apdex.rb +9 -9
  91. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/background_transaction.rb +1 -1
  92. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/client.rb +8 -8
  93. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/controller.rb +9 -9
  94. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/controller_cpu.rb +4 -4
  95. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/controller_ext.rb +2 -2
  96. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/database.rb +8 -8
  97. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/database_pool.rb +3 -3
  98. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/dot_net.rb +6 -6
  99. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/dot_net_parser.rb +3 -3
  100. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/external.rb +2 -2
  101. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/frontend.rb +6 -6
  102. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/gc.rb +2 -2
  103. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/hibernate_session.rb +1 -1
  104. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/java.rb +4 -4
  105. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/java_parser.rb +3 -3
  106. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/jsp.rb +4 -4
  107. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/jsp_tag.rb +1 -1
  108. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/mem_cache.rb +1 -1
  109. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/metric_parser.rb +21 -21
  110. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/orm.rb +2 -2
  111. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/other_transaction.rb +6 -6
  112. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/servlet.rb +2 -2
  113. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/servlet_context_listener.rb +1 -1
  114. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/servlet_filter.rb +1 -1
  115. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/solr.rb +3 -3
  116. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/solr_request_handler.rb +1 -1
  117. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/spring.rb +8 -8
  118. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/struts_action.rb +3 -3
  119. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/struts_result.rb +3 -3
  120. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/view.rb +5 -5
  121. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/web_transaction.rb +20 -20
  122. metadata +15 -9
  123. data/lib/new_relic/agent/instrumentation/sequel.rb +0 -109
@@ -2,13 +2,13 @@ module NewRelic
2
2
  module MetricParser
3
3
  module DotNetParser
4
4
  def class_name_without_package
5
- full_class_name =~ /(.*\.)(.*)$/ ? $2 : full_class_name
5
+ full_class_name =~ /(.*\.)(.*)$/ ? $2 : full_class_name
6
6
  end
7
-
7
+
8
8
  def developer_name
9
9
  "#{full_class_name}.#{method_name}()"
10
10
  end
11
-
11
+
12
12
  def short_name
13
13
  "#{class_name_without_package}.#{method_name}()"
14
14
  end
@@ -2,7 +2,7 @@ require 'new_relic/metric_parser'
2
2
  module NewRelic
3
3
  module MetricParser
4
4
  class External < NewRelic::MetricParser::MetricParser
5
-
5
+
6
6
  def all?
7
7
  host == 'all' || host == 'allWeb' || host == 'allOther'
8
8
  end
@@ -39,7 +39,7 @@ module NewRelic
39
39
  end
40
40
  end
41
41
  def developer_name
42
- case
42
+ case
43
43
  when all?
44
44
  'All External'
45
45
  when hosts_all?
@@ -1,5 +1,5 @@
1
1
  class NewRelic::MetricParser::Frontend < NewRelic::MetricParser::MetricParser
2
-
2
+
3
3
  =begin
4
4
  def action_name
5
5
  if segments[-1] =~ /^\(other\)$/
@@ -9,12 +9,12 @@ class NewRelic::MetricParser::Frontend < NewRelic::MetricParser::MetricParser
9
9
  end
10
10
  end
11
11
  =end
12
-
12
+
13
13
  def developer_name
14
14
  url
15
15
  #"#{controller_name}##{action_name}"
16
16
  end
17
-
17
+
18
18
  def short_name
19
19
  # standard controller actions
20
20
  if segments.length > 1
@@ -23,12 +23,12 @@ class NewRelic::MetricParser::Frontend < NewRelic::MetricParser::MetricParser
23
23
  'All Frontend Urls'
24
24
  end
25
25
  end
26
-
26
+
27
27
  def url
28
28
  '/' + segments[1..-1].join('/')
29
29
  end
30
-
31
- # this is used to match transaction traces to controller actions.
30
+
31
+ # this is used to match transaction traces to controller actions.
32
32
  # TT's don't have a preceding slash :P
33
33
  def tt_path
34
34
  segments[1..-1].join('/')
@@ -1,5 +1,5 @@
1
1
  class NewRelic::MetricParser::GC < NewRelic::MetricParser::MetricParser
2
-
2
+
3
3
  def developer_name
4
4
  if segments.length == 1
5
5
  "GC"
@@ -9,7 +9,7 @@ class NewRelic::MetricParser::GC < NewRelic::MetricParser::MetricParser
9
9
  "GC - #{segment_1}"
10
10
  end
11
11
  end
12
-
12
+
13
13
  def short_name
14
14
  if segments.length > 1
15
15
  developer_name
@@ -1,6 +1,6 @@
1
1
  require 'new_relic/metric_parser/java'
2
2
  class NewRelic::MetricParser::HibernateSession < NewRelic::MetricParser::Java
3
-
3
+
4
4
  def call_rate_suffix
5
5
  'cpm'
6
6
  end
@@ -4,12 +4,12 @@ module NewRelic
4
4
  class Java < NewRelic::MetricParser::MetricParser
5
5
  JavaParser
6
6
  def initialize(name)
7
- super
7
+ super
8
8
  if segments.length > 2
9
9
  self.extend NewRelic::MetricParser::JavaParser
10
10
  end
11
11
  end
12
-
12
+
13
13
  def pie_chart_label
14
14
  short_name
15
15
  end
@@ -17,11 +17,11 @@ module NewRelic
17
17
  def tooltip_name
18
18
  developer_name
19
19
  end
20
-
20
+
21
21
  def full_class_name
22
22
  segment_1
23
23
  end
24
-
24
+
25
25
  def method_name
26
26
  segment_2
27
27
  end
@@ -2,13 +2,13 @@ module NewRelic
2
2
  module MetricParser
3
3
  module JavaParser
4
4
  def class_name_without_package
5
- full_class_name =~ /(.*\.)(.*)$/ ? $2 : full_class_name
5
+ full_class_name =~ /(.*\.)(.*)$/ ? $2 : full_class_name
6
6
  end
7
-
7
+
8
8
  def developer_name
9
9
  "#{full_class_name}.#{method_name}()"
10
10
  end
11
-
11
+
12
12
  def short_name
13
13
  "#{class_name_without_package}.#{method_name}()"
14
14
  end
@@ -3,15 +3,15 @@ class NewRelic::MetricParser::Jsp < NewRelic::MetricParser::MetricParser
3
3
  def pie_chart_label
4
4
  short_name
5
5
  end
6
-
6
+
7
7
  def short_name
8
8
  segments[-1]
9
9
  end
10
-
10
+
11
11
  def controller_name
12
12
  file_name
13
13
  end
14
-
14
+
15
15
  def tooltip_name
16
16
  developer_name
17
17
  end
@@ -23,7 +23,7 @@ class NewRelic::MetricParser::Jsp < NewRelic::MetricParser::MetricParser
23
23
  def developer_name
24
24
  file_name
25
25
  end
26
-
26
+
27
27
  def url
28
28
  '/' + file_name
29
29
  end
@@ -1,6 +1,6 @@
1
1
  require 'new_relic/metric_parser/java'
2
2
  class NewRelic::MetricParser::JspTag < NewRelic::MetricParser::Java
3
-
3
+
4
4
  def call_rate_suffix
5
5
  'cpm'
6
6
  end
@@ -3,7 +3,7 @@ module NewRelic
3
3
  module MetricParser
4
4
  class MemCache < NewRelic::MetricParser::MetricParser
5
5
  def is_memcache?; true; end
6
-
6
+
7
7
  # for MemCache metrics, the short name is actually
8
8
  # the full name
9
9
  def short_name
@@ -1,13 +1,13 @@
1
1
  module NewRelic
2
2
  module MetricParser
3
3
  class MetricParser
4
-
4
+
5
5
  SEPARATOR = '/' unless defined? SEPARATOR
6
6
  attr_reader :name
7
-
7
+
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
11
  # return a string that is parsable via the Metric parser APIs
12
12
  def self.for_metric_named(s)
13
13
  category = (s =~ /^([^\/]*)/) && $1
@@ -21,7 +21,7 @@ module NewRelic
21
21
  def self.parse(s)
22
22
  for_metric_named(s)
23
23
  end
24
-
24
+
25
25
  def method_missing(method_name, *args)
26
26
  return false if method_name.to_s =~ /^is_.*\?/
27
27
  super
@@ -37,45 +37,45 @@ module NewRelic
37
37
  segments[1..-1].join(SEPARATOR)
38
38
  end
39
39
  end
40
-
40
+
41
41
  def pie_chart_label
42
42
  developer_name
43
43
  end
44
-
44
+
45
45
  def developer_name
46
46
  short_name
47
47
  end
48
-
48
+
49
49
  def tooltip_name
50
50
  short_name
51
51
  end
52
-
52
+
53
53
  def apdex_metric_path
54
54
  %Q[Apdex/#{segments[1..-1].join('/')}]
55
55
  end
56
-
56
+
57
57
  # A short name for legends in the graphs
58
58
  def legend_name
59
59
  short_name
60
60
  end
61
-
61
+
62
62
  # Return the name of another metric if the current
63
63
  # metric is really add-on data for another metric.
64
64
  def base_metric_name
65
65
  nil
66
66
  end
67
-
68
- # Category is a UI description of the general
67
+
68
+ # Category is a UI description of the general
69
69
  # category of metrics for this metric.
70
70
  def category
71
71
  segments[0]
72
72
  end
73
-
73
+
74
74
  def segments
75
75
  return [] if !name
76
76
  @segments ||= name.split(SEPARATOR).freeze
77
77
  end
78
-
78
+
79
79
  # --
80
80
  # These accessors are used to allow chart to use a specific segment in the metric
81
81
  # name for label construction as a zero-arg accessor
@@ -87,18 +87,18 @@ module NewRelic
87
87
  def segment_4; segments[4]; end
88
88
  def segment_5; segments[5]; end
89
89
  def last_segment; segments.last; end
90
-
90
+
91
91
  # This is the suffix used for call rate or throughput. By default, it's cpm
92
92
  # but things like controller actions will override to use something like 'rpm'
93
93
  # for requests per minute
94
94
  def call_rate_suffix
95
95
  'cpm'
96
96
  end
97
-
97
+
98
98
  def url
99
99
  ''
100
100
  end
101
- # Return the list of dispatcher metrics that correspond to this metric. That is,
101
+ # Return the list of dispatcher metrics that correspond to this metric. That is,
102
102
  # the summary metrics which should also be recorded when this metric is recorded.
103
103
  def summary_metrics
104
104
  []
@@ -106,17 +106,17 @@ module NewRelic
106
106
  # returns a hash of params for url_for(), giving you a drilldown URL to an RPM page for this metric
107
107
  # define in subclasses - TB 2009-12-18
108
108
  # def drilldown_url(metric_id); end
109
-
109
+
110
110
  def initialize(name)
111
111
  @name = name
112
112
  end
113
-
113
+
114
114
  # These would be reflected properly by method missing; consider
115
115
  # this an optimization
116
116
  def is_controller?; false; end
117
117
  def is_transaction?; false; end
118
-
119
- end
118
+
119
+ end
120
120
  end
121
121
  end
122
122
 
@@ -14,10 +14,10 @@ module NewRelic
14
14
  end
15
15
  end
16
16
  end
17
-
17
+
18
18
  def initialize(name)
19
19
  super
20
-
20
+
21
21
  if segment_1 == "Hibernate"
22
22
  self.extend NewRelic::MetricParser::ORM::Hibernate
23
23
  end
@@ -4,30 +4,30 @@ require 'new_relic/metric_parser'
4
4
  module NewRelic
5
5
  module MetricParser
6
6
  class OtherTransaction < NewRelic::MetricParser::MetricParser
7
-
7
+
8
8
  def is_transaction?
9
9
  true
10
10
  end
11
11
  def task
12
12
  segments[1]
13
13
  end
14
-
14
+
15
15
  def developer_name
16
16
  segments[2..-1].join(NewRelic::MetricParser::MetricParser::SEPARATOR)
17
17
  end
18
-
18
+
19
19
  def short_name
20
20
  developer_name
21
21
  end
22
-
22
+
23
23
  def drilldown_url(metric_id)
24
24
  {:controller => '/v2/background_tasks', :action => 'index', :task => task, :anchor => "id=#{metric_id}"}
25
25
  end
26
-
26
+
27
27
  def path
28
28
  segments[2..-1].join "/"
29
29
  end
30
-
30
+
31
31
  def summary_metrics
32
32
  if segments.size > 2
33
33
  %W[OtherTransaction/#{task}/all OtherTransaction/all]
@@ -1,6 +1,6 @@
1
1
  require 'new_relic/metric_parser/java'
2
- class NewRelic::MetricParser::Servlet < NewRelic::MetricParser::Java
3
-
2
+ class NewRelic::MetricParser::Servlet < NewRelic::MetricParser::Java
3
+
4
4
  def call_rate_suffix
5
5
  'cpm'
6
6
  end
@@ -1,6 +1,6 @@
1
1
  require 'new_relic/metric_parser/java'
2
2
  class NewRelic::MetricParser::ServletContextListener < NewRelic::MetricParser::Java
3
-
3
+
4
4
  def call_rate_suffix
5
5
  'cpm'
6
6
  end
@@ -1,6 +1,6 @@
1
1
  require 'new_relic/metric_parser/java'
2
2
  class NewRelic::MetricParser::ServletFilter < NewRelic::MetricParser::Java
3
-
3
+
4
4
  def call_rate_suffix
5
5
  'cpm'
6
6
  end
@@ -1,5 +1,5 @@
1
1
  class NewRelic::MetricParser::Solr < NewRelic::MetricParser::MetricParser
2
-
2
+
3
3
  def short_name
4
4
  if segments[1] == "org.apache.solr.search.SolrIndexSearcher"
5
5
  "SolrIndexSearcher"
@@ -11,7 +11,7 @@ class NewRelic::MetricParser::Solr < NewRelic::MetricParser::MetricParser
11
11
  end
12
12
 
13
13
  def legend_name
14
- if all?
14
+ if all?
15
15
  'Solr'
16
16
  else
17
17
  super
@@ -19,7 +19,7 @@ class NewRelic::MetricParser::Solr < NewRelic::MetricParser::MetricParser
19
19
  end
20
20
 
21
21
  def category; 'Solr Query'; end
22
-
22
+
23
23
  private
24
24
  def all?
25
25
  name == Metric::SOLR_ALL_WEB
@@ -1,6 +1,6 @@
1
1
  #require 'new_relic/metric_parser/java'
2
2
  class NewRelic::MetricParser::SolrRequestHandler < NewRelic::MetricParser::MetricParser
3
-
3
+
4
4
  def short_name
5
5
  if segments[1] == "org.apache.solr.handler.XmlUpdateRequestHandler"
6
6
  "UpdateProcessor"
@@ -1,7 +1,7 @@
1
1
  class NewRelic::MetricParser::Spring < NewRelic::MetricParser::MetricParser
2
2
  def initialize(name)
3
3
  super
4
-
4
+
5
5
  if segment_1 == 'Java'
6
6
  self.extend JavaParser
7
7
  end
@@ -15,7 +15,7 @@ class NewRelic::MetricParser::Spring < NewRelic::MetricParser::MetricParser
15
15
  =end
16
16
  end
17
17
 
18
-
18
+
19
19
  def pie_chart_label
20
20
  short_name
21
21
  end
@@ -23,28 +23,28 @@ class NewRelic::MetricParser::Spring < NewRelic::MetricParser::MetricParser
23
23
  def tooltip_name
24
24
  developer_name
25
25
  end
26
-
26
+
27
27
  def component_type
28
28
  'Spring'
29
29
  end
30
-
30
+
31
31
  def short_name
32
32
  component_type + ' ' + developer_name
33
33
  end
34
-
34
+
35
35
  def developer_name
36
36
  '/' + segments[1..-1].join(SEPARATOR)
37
37
  end
38
-
38
+
39
39
  module JavaParser
40
40
  def developer_name
41
41
  "#{segment_2}.#{segment_3}()"
42
42
  end
43
-
43
+
44
44
  def class_name_without_package
45
45
  segment_2 =~ /(.*\.)(.*)$/ ? $2 : segment_2
46
46
  end
47
-
47
+
48
48
  # class name with/out package name and method name
49
49
  def short_name
50
50
  "#{component_type} #{class_name_without_package}.#{segment_3}()"