Class: MetricFu::Hotspot
- Inherits:
-
Object
show all
- Defined in:
- lib/metric_fu/metrics/hotspots/hotspot.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.analyzer_for_metric(metric) ⇒ Object
13
14
15
16
17
18
|
# File 'lib/metric_fu/metrics/hotspots/hotspot.rb', line 13
def self.analyzer_for_metric(metric)
@analyzers.fetch(metric.to_sym) do
message = "Unknown metric #{metric}. We only know #{@analyzers.keys.inspect}"
fail MetricFu::AnalysisError, message
end
end
|
.analyzers ⇒ Object
10
11
12
|
# File 'lib/metric_fu/metrics/hotspots/hotspot.rb', line 10
def self.analyzers
@analyzers.values
end
|
.metric ⇒ Object
6
7
8
|
# File 'lib/metric_fu/metrics/hotspots/hotspot.rb', line 6
def self.metric
name.split("::")[-1].split("Hotspot")[0].downcase.to_sym
end
|
Instance Method Details
#generate_records(_data, _table) ⇒ Object
Transforms the data param, if non-nil, into a hash with keys:
'metric', etc.
and appends the hash to the table param
Has no return value
74
75
76
|
# File 'lib/metric_fu/metrics/hotspots/hotspot.rb', line 74
def generate_records(_data, _table)
not_implemented
end
|
#get_mean(collection) ⇒ Object
#map(row) ⇒ Object
28
29
30
|
# File 'lib/metric_fu/metrics/hotspots/hotspot.rb', line 28
def map(row)
mapping_strategies.fetch(map_strategy) { row.public_send(map_strategy) }
end
|
#map_strategy ⇒ Object
39
40
41
|
# File 'lib/metric_fu/metrics/hotspots/hotspot.rb', line 39
def map_strategy
not_implemented
end
|
#mapping_strategies ⇒ Object
32
33
34
35
36
37
|
# File 'lib/metric_fu/metrics/hotspots/hotspot.rb', line 32
def mapping_strategies
{
present: 1,
absent: 0,
}
end
|
#not_implemented ⇒ Object
83
84
85
|
# File 'lib/metric_fu/metrics/hotspots/hotspot.rb', line 83
def not_implemented
raise "#{caller[0]} not implemented"
end
|
#present_group(_group) ⇒ String
Returns description result.
79
80
81
|
# File 'lib/metric_fu/metrics/hotspots/hotspot.rb', line 79
def present_group(_group)
not_implemented
end
|
#reduce_strategy ⇒ Object
53
54
55
|
# File 'lib/metric_fu/metrics/hotspots/hotspot.rb', line 53
def reduce_strategy
not_implemented
end
|
#score(metric_ranking, item) ⇒ Integer
#score_strategy ⇒ Object
66
67
68
|
# File 'lib/metric_fu/metrics/hotspots/hotspot.rb', line 66
def score_strategy
not_implemented
end
|