Add a test for DumbSpreadingPriority.

This commit is contained in:
David Oppenheimer
2015-07-03 01:34:07 -07:00
parent cb9d515004
commit 53518e37a6
5 changed files with 102 additions and 5 deletions

View File

@@ -20,6 +20,7 @@ import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
"github.com/GoogleCloudPlatform/kubernetes/plugin/pkg/scheduler/algorithm"
"github.com/golang/glog"
)
type ServiceSpread struct {
@@ -82,6 +83,10 @@ func (s *ServiceSpread) CalculateSpreadPriority(pod *api.Pod, podLister algorith
fScore = 10 * (float32(maxCount-counts[minion.Name]) / float32(maxCount))
}
result = append(result, algorithm.HostPriority{Host: minion.Name, Score: int(fScore)})
// glog.V(10).Infof(
glog.Infof(
"%v -> %v: ServiceSpreadPriority, Sore: (%d)", pod.Name, minion.Name, int(fScore),
)
}
return result, nil
}