fix the Store to be Indexer

This commit is contained in:
zhouhaibing089 2016-05-18 10:15:02 +08:00 committed by haibzhou
parent 07d1060192
commit 2afa7eed44
2 changed files with 3 additions and 3 deletions

View File

@ -56,7 +56,7 @@ func benchmarkScheduling(numNodes, numScheduledPods int, b *testing.B) {
makeNodes(c, numNodes)
makePodsFromRC(c, "rc1", numScheduledPods)
for {
scheduled := schedulerConfigFactory.ScheduledPodLister.Store.List()
scheduled := schedulerConfigFactory.ScheduledPodLister.Indexer.List()
if len(scheduled) >= numScheduledPods {
break
}
@ -68,7 +68,7 @@ func benchmarkScheduling(numNodes, numScheduledPods int, b *testing.B) {
for {
// This can potentially affect performance of scheduler, since List() is done under mutex.
// TODO: Setup watch on apiserver and wait until all pods scheduled.
scheduled := schedulerConfigFactory.ScheduledPodLister.Store.List()
scheduled := schedulerConfigFactory.ScheduledPodLister.Indexer.List()
if len(scheduled) >= numScheduledPods+b.N {
break
}

View File

@ -50,7 +50,7 @@ func schedulePods(numNodes, numPods int) {
// This can potentially affect performance of scheduler, since List() is done under mutex.
// Listing 10000 pods is an expensive operation, so running it frequently may impact scheduler.
// TODO: Setup watch on apiserver and wait until all pods scheduled.
scheduled := schedulerConfigFactory.ScheduledPodLister.Store.List()
scheduled := schedulerConfigFactory.ScheduledPodLister.Indexer.List()
fmt.Printf("%ds\trate: %d\ttotal: %d\n", time.Since(start)/time.Second, len(scheduled)-prev, len(scheduled))
if len(scheduled) >= numPods {
return