Gilad Chaplik has uploaded a new change for review. Change subject: core: more accurate scores for ED weight module ......................................................................
core: more accurate scores for ED weight module Even Distribution (ED) weight module inner calculation score is a real number, and we expose it as an integer by rounding it up. Currently we round it up (Math.ceil), but to be more accurate we should round it to nearest integer (Math.round). To avoid 0 adding 1 to the score. Change-Id: Ib668cf266629eb4e0f2c1cbd5ac893dc7deac19c Bug-Url: https://bugzilla.redhat.com/1040460 Signed-off-by: Gilad Chaplik <[email protected]> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/policyunits/EvenDistributionWeightPolicyUnit.java 1 file changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/36/22336/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/policyunits/EvenDistributionWeightPolicyUnit.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/policyunits/EvenDistributionWeightPolicyUnit.java index 17d6bef..898817d 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/policyunits/EvenDistributionWeightPolicyUnit.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/policyunits/EvenDistributionWeightPolicyUnit.java @@ -46,8 +46,9 @@ if (effectiveCpuCores != null && vds.getUsageCpuPercent() != null && vds.getPendingVcpusCount() != null) { - // round up result, fractions matters - score = Math.min((int) Math.ceil(calcDistributeMetric(vds, vm, effectiveCpuCores)), MaxSchedulerWeight); + // round the result and adding one to avoid zero + score = Math.min((int) Math.round( + calcDistributeMetric(vds, vm, effectiveCpuCores)) + 1, MaxSchedulerWeight); } return score; } -- To view, visit http://gerrit.ovirt.org/22336 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib668cf266629eb4e0f2c1cbd5ac893dc7deac19c Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Gilad Chaplik <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
