0
0
Fork 0

Remove static setting of total amount of cores

This commit is contained in:
Stormwind 2015-04-26 19:08:34 +02:00
parent 6916446089
commit 2f61b479eb
2 changed files with 2 additions and 6 deletions

View File

@ -20,16 +20,14 @@ module Rubella
# prepare data
data_list = Array.new()
bucket_no = 0
total_amount = nil
input.each do |cores|
total_amount = cores.length if total_amount.nil?
# every 10 load percent one heatpoint
i = 0
data_list << Array.new(buckets) do
amount = cores.select { |core| core >= i and core < (i+@steps)}.length
i = i + @steps
core = (amount.to_f*bucket_no**0.8)/total_amount
core = (amount.to_f*bucket_no**0.8)/cores.length
bucket_no = bucket_no + 1
core

View File

@ -19,16 +19,14 @@ module Rubella
def parse input
# prepare data
data_list = Array.new()
total_amount = nil
input.each do |cores|
total_amount = cores.length if total_amount.nil?
# every 10 load percent one heatpoint
i = 0
data_list << Array.new(buckets) do
amount = cores.select { |core| core >= i and core < (i+@steps)}.length
i = i + @steps
amount.to_f/total_amount
amount.to_f/cores.length
end
end