Class: MetricFu::Ranking

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/metric_fu/metrics/hotspots/analysis/ranking.rb

Instance Method Summary collapse

Constructor Details

#initializeRanking

Returns a new instance of Ranking.



6
7
8
# File 'lib/metric_fu/metrics/hotspots/analysis/ranking.rb', line 6

def initialize
  @items_to_score = {}
end

Instance Method Details

#percentile(item) ⇒ Object



14
15
16
17
18
# File 'lib/metric_fu/metrics/hotspots/analysis/ranking.rb', line 14

def percentile(item)
  index = sorted_items.index(item)
  worse_item_count = (length - (index + 1))
  worse_item_count.to_f / length
end

#topObject



10
11
12
# File 'lib/metric_fu/metrics/hotspots/analysis/ranking.rb', line 10

def top
  sorted_items
end