Fix bug in weighting
Now 100 counts to the last bucket. Before it was excluded from being shown...
This commit is contained in:
parent
ebd5b88861
commit
a30db71066
|
@ -25,7 +25,12 @@ module Rubella
|
||||||
# every 10 load percent one heatpoint
|
# every 10 load percent one heatpoint
|
||||||
i = 0
|
i = 0
|
||||||
data_list << Array.new(buckets) do
|
data_list << Array.new(buckets) do
|
||||||
amount = cores.select { |core| core >= i and core < (i+@steps)}.length
|
current_cores = cores.select do |core|
|
||||||
|
core >= i and
|
||||||
|
((core < (i+@steps)) or (core <= (i+@steps) and i+@steps == 100))
|
||||||
|
end
|
||||||
|
|
||||||
|
amount = current_cores.length
|
||||||
i = i + @steps
|
i = i + @steps
|
||||||
core = (amount.to_f*bucket_no**0.8)/cores.length
|
core = (amount.to_f*bucket_no**0.8)/cores.length
|
||||||
bucket_no = bucket_no + 1
|
bucket_no = bucket_no + 1
|
||||||
|
|
|
@ -32,7 +32,10 @@ module Rubella
|
||||||
i = 0
|
i = 0
|
||||||
data_list << Array.new(buckets) do
|
data_list << Array.new(buckets) do
|
||||||
# Select all current cores
|
# Select all current cores
|
||||||
selected_cores = cores.select { |core| core >= i and core < (i+@steps)}
|
selected_cores = cores.select do |core|
|
||||||
|
core >= i and
|
||||||
|
((core < (i+@steps)) or (core <= (i+@steps) and i+@steps == 100))
|
||||||
|
end
|
||||||
i = i + @steps
|
i = i + @steps
|
||||||
|
|
||||||
# add the load of the resulting cores and multiply it with the overall value
|
# add the load of the resulting cores and multiply it with the overall value
|
||||||
|
|
|
@ -24,8 +24,12 @@ module Rubella
|
||||||
# every 10 load percent one heatpoint
|
# every 10 load percent one heatpoint
|
||||||
i = 0
|
i = 0
|
||||||
data_list << Array.new(buckets) do
|
data_list << Array.new(buckets) do
|
||||||
amount = cores.select { |core| core >= i and core < (i+@steps)}.length
|
current_cores = cores.select do |core|
|
||||||
i = i + @steps
|
core >= i and
|
||||||
|
((core < (i+@steps)) or (core <= (i+@steps) and i+@steps == 100))
|
||||||
|
end
|
||||||
|
amount = current_cores.length
|
||||||
|
i = i + @steps
|
||||||
amount.to_f/cores.length
|
amount.to_f/cores.length
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue