Class: NewRelic::MetricParser::ControllerCPU

Inherits:
NewRelic::MetricParser show all
Defined in:
lib/new_relic/metric_parser/controller_cpu.rb

Constant Summary

Constants inherited from NewRelic::MetricParser

SEPARATOR

Instance Attribute Summary

Attributes inherited from NewRelic::MetricParser

#name

Instance Method Summary collapse

Methods inherited from NewRelic::MetricParser

#apdex_metric_path, #category, for_metric_named, #initialize, #is_controller?, #is_transaction?, #last_segment, #legend_name, #method_missing, parse, #pie_chart_label, #segment_0, #segment_1, #segment_2, #segment_3, #segment_4, #segment_5, #segments, #summary_metrics, #tooltip_name

Constructor Details

This class inherits a constructor from NewRelic::MetricParser

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class NewRelic::MetricParser

Instance Method Details

#action_nameObject



9
10
11
# File 'lib/new_relic/metric_parser/controller_cpu.rb', line 9

def action_name
  segments[-1]
end

#base_metric_nameObject



17
18
19
# File 'lib/new_relic/metric_parser/controller_cpu.rb', line 17

def base_metric_name
  "Controller/" + segments[1..-1].join('/')
end

#call_rate_suffixObject



34
35
36
# File 'lib/new_relic/metric_parser/controller_cpu.rb', line 34

def call_rate_suffix
  'rpm'
end

#controller_nameObject



5
6
7
# File 'lib/new_relic/metric_parser/controller_cpu.rb', line 5

def controller_name
  segments[1..-2].join('/').camelize+"Controller"
end

#developer_nameObject



13
14
15
# File 'lib/new_relic/metric_parser/controller_cpu.rb', line 13

def developer_name
  "#{controller_name}##{action_name}"
end

#is_controller_cpu?Boolean

Returns:

  • (Boolean)


3
# File 'lib/new_relic/metric_parser/controller_cpu.rb', line 3

def is_controller_cpu?; true; end

#short_nameObject



21
22
23
24
25
26
27
28
# File 'lib/new_relic/metric_parser/controller_cpu.rb', line 21

def short_name
  # standard controller actions
  if segments.length > 1
    url
  else
    'All Controller Actions'
  end
end

#urlObject



30
31
32
# File 'lib/new_relic/metric_parser/controller_cpu.rb', line 30

def url
  '/' + segments[1..-1].join('/')
end