Class: NewRelic::MetricParser::View
Constant Summary
SEPARATOR
Instance Attribute Summary
#name
Instance Method Summary
collapse
#apdex_metric_path, #base_metric_name, #call_rate_suffix, #category, for_metric_named, #initialize, #last_segment, #legend_name, #method_missing, parse, #segment_0, #segment_1, #segment_2, #segment_3, #segment_4, #segments, #tooltip_name
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class NewRelic::MetricParser
Instance Method Details
#action_name ⇒ Object
43
44
45
46
|
# File 'lib/new_relic/metric_parser/view.rb', line 43
def action_name
segments[-2].gsub(/\..*$/, "")
end
|
#controller_name ⇒ Object
39
40
41
|
# File 'lib/new_relic/metric_parser/view.rb', line 39
def controller_name
template_label
end
|
#developer_name ⇒ Object
48
49
50
|
# File 'lib/new_relic/metric_parser/view.rb', line 48
def developer_name
template_label
end
|
#is_compiler? ⇒ Boolean
7
8
9
|
# File 'lib/new_relic/metric_parser/view.rb', line 7
def is_compiler?
segments.last == "Compile"
end
|
#is_render? ⇒ Boolean
4
5
6
|
# File 'lib/new_relic/metric_parser/view.rb', line 4
def is_render?
segments.last == "Rendering"
end
|
#is_view? ⇒ Boolean
2
|
# File 'lib/new_relic/metric_parser/view.rb', line 2
def is_view?; true; end
|
#pie_chart_label ⇒ Object
10
11
12
13
14
15
16
17
18
19
20
21
|
# File 'lib/new_relic/metric_parser/view.rb', line 10
def pie_chart_label
case segments.last
when "Rendering"
"#{file_name(segments[-2])} Template"
when "Partial"
"#{file_name(segments[-2])} Partial"
when ".rhtml Processing"
"ERB compilation"
else
segments[1..-1]
end
end
|
#template_label ⇒ Object
22
23
24
25
26
27
28
29
30
31
32
33
|
# File 'lib/new_relic/metric_parser/view.rb', line 22
def template_label
case segments.last
when "Rendering"
"#{file_name(segments[1..-2].join(NewRelic::MetricParser::SEPARATOR))} Template"
when "Partial"
"#{file_name(segments[1..-2].join(NewRelic::MetricParser::SEPARATOR))} Partial"
when ".rhtml Processing"
"ERB compilation"
else
segments[1..-1].join("/")
end
end
|
52
53
54
|
# File 'lib/new_relic/metric_parser/view.rb', line 52
def url
'/' + file_name(segments[1..-2].join('/'))
end
|