Class: NewRelic::MetricParser::Apdex
Constant Summary
collapse
- CLIENT =
'Client'
SEPARATOR
Instance Attribute Summary
#name
Class Method Summary
collapse
Instance Method Summary
collapse
#apdex_metric_path, #base_metric_name, #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
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class NewRelic::MetricParser
Class Method Details
.browser_client_metric(os, browser, version, apdex_t) ⇒ Object
13
14
15
|
# File 'lib/new_relic/metric_parser/apdex.rb', line 13
def self.browser_client_metric(os, browser, version, apdex_t)
"#{self.client_metric(apdex_t)}/#{os}/#{browser}/#{version}"
end
|
.client_metric(apdex_t) ⇒ Object
Convenience method for creating the appropriate client metric name.
10
11
12
|
# File 'lib/new_relic/metric_parser/apdex.rb', line 10
def self.client_metric(apdex_t)
"Apdex/#{CLIENT}/#{apdex_t}"
end
|
Instance Method Details
#apdex_t ⇒ Object
31
32
33
|
# File 'lib/new_relic/metric_parser/apdex.rb', line 31
def apdex_t
is_client? && segments[2].to_f
end
|
#browser ⇒ Object
39
40
41
|
# File 'lib/new_relic/metric_parser/apdex.rb', line 39
def browser
is_browser_summary? && segments[4]
end
|
#browser_version ⇒ Object
43
44
45
|
# File 'lib/new_relic/metric_parser/apdex.rb', line 43
def browser_version
is_browser_summary? && segments[5]
end
|
#call_rate_suffix ⇒ Object
83
84
85
|
# File 'lib/new_relic/metric_parser/apdex.rb', line 83
def call_rate_suffix
'rpm'
end
|
#developer_name ⇒ Object
55
56
57
58
59
60
61
62
|
# File 'lib/new_relic/metric_parser/apdex.rb', line 55
def developer_name
case
when is_client? then "Apdex Client (#{apdex_t})"
when is_browser_summary? then "Apdex Client for #{os_and_browser} (#{apdex_t})"
when is_summary? then "Apdex"
else "Apdex #{segments[1..-1].join("/")}"
end
end
|
#is_browser_summary? ⇒ Boolean
23
24
25
|
# File 'lib/new_relic/metric_parser/apdex.rb', line 23
def is_browser_summary?
is_client? && segments.size == 6
end
|
#is_client? ⇒ Boolean
17
18
19
|
# File 'lib/new_relic/metric_parser/apdex.rb', line 17
def is_client?
segments[1] == CLIENT
end
|
#is_client_summary? ⇒ Boolean
20
21
22
|
# File 'lib/new_relic/metric_parser/apdex.rb', line 20
def is_client_summary?
is_client? && segments.size == 3
end
|
#is_summary? ⇒ Boolean
26
27
28
|
# File 'lib/new_relic/metric_parser/apdex.rb', line 26
def is_summary?
segments.size == 1
end
|
35
36
37
|
# File 'lib/new_relic/metric_parser/apdex.rb', line 35
def platform
is_browser_summary? && segments[3]
end
|
51
52
53
|
# File 'lib/new_relic/metric_parser/apdex.rb', line 51
def platform_and_user_agent
is_browser_summary? && segments[3..-1].join(" ")
end
|
#short_name ⇒ Object
64
65
66
67
68
69
70
71
|
# File 'lib/new_relic/metric_parser/apdex.rb', line 64
def short_name
if segments.length > 1
url
else
'All Frontend Urls'
end
end
|
#tt_path ⇒ Object
this is used to match transaction traces to controller actions. TT’s don’t have a preceding slash :P
79
80
81
|
# File 'lib/new_relic/metric_parser/apdex.rb', line 79
def tt_path
segments[1..-1].join('/')
end
|
#url ⇒ Object
73
74
75
|
# File 'lib/new_relic/metric_parser/apdex.rb', line 73
def url
'/' + segments[1..-1].join('/')
end
|
#user_agent ⇒ Object
47
48
49
|
# File 'lib/new_relic/metric_parser/apdex.rb', line 47
def user_agent
is_browser_summary? && segments[4..-1].join(" ")
end
|