Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
2afa7eed
Commit
2afa7eed
authored
May 18, 2016
by
zhouhaibing089
Committed by
haibzhou
May 18, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix the Store to be Indexer
parent
07d10601
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
scheduler_bench_test.go
test/component/scheduler/perf/scheduler_bench_test.go
+2
-2
scheduler_test.go
test/component/scheduler/perf/scheduler_test.go
+1
-1
No files found.
test/component/scheduler/perf/scheduler_bench_test.go
View file @
2afa7eed
...
@@ -56,7 +56,7 @@ func benchmarkScheduling(numNodes, numScheduledPods int, b *testing.B) {
...
@@ -56,7 +56,7 @@ func benchmarkScheduling(numNodes, numScheduledPods int, b *testing.B) {
makeNodes
(
c
,
numNodes
)
makeNodes
(
c
,
numNodes
)
makePodsFromRC
(
c
,
"rc1"
,
numScheduledPods
)
makePodsFromRC
(
c
,
"rc1"
,
numScheduledPods
)
for
{
for
{
scheduled
:=
schedulerConfigFactory
.
ScheduledPodLister
.
Store
.
List
()
scheduled
:=
schedulerConfigFactory
.
ScheduledPodLister
.
Indexer
.
List
()
if
len
(
scheduled
)
>=
numScheduledPods
{
if
len
(
scheduled
)
>=
numScheduledPods
{
break
break
}
}
...
@@ -68,7 +68,7 @@ func benchmarkScheduling(numNodes, numScheduledPods int, b *testing.B) {
...
@@ -68,7 +68,7 @@ func benchmarkScheduling(numNodes, numScheduledPods int, b *testing.B) {
for
{
for
{
// This can potentially affect performance of scheduler, since List() is done under mutex.
// This can potentially affect performance of scheduler, since List() is done under mutex.
// TODO: Setup watch on apiserver and wait until all pods scheduled.
// 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
{
if
len
(
scheduled
)
>=
numScheduledPods
+
b
.
N
{
break
break
}
}
...
...
test/component/scheduler/perf/scheduler_test.go
View file @
2afa7eed
...
@@ -50,7 +50,7 @@ func schedulePods(numNodes, numPods int) {
...
@@ -50,7 +50,7 @@ func schedulePods(numNodes, numPods int) {
// This can potentially affect performance of scheduler, since List() is done under mutex.
// 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.
// 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.
// TODO: Setup watch on apiserver and wait until all pods scheduled.
scheduled
:=
schedulerConfigFactory
.
ScheduledPodLister
.
Store
.
List
()
scheduled
:=
schedulerConfigFactory
.
ScheduledPodLister
.
Indexer
.
List
()
fmt
.
Printf
(
"%ds
\t
rate: %d
\t
total: %d
\n
"
,
time
.
Since
(
start
)
/
time
.
Second
,
len
(
scheduled
)
-
prev
,
len
(
scheduled
))
fmt
.
Printf
(
"%ds
\t
rate: %d
\t
total: %d
\n
"
,
time
.
Since
(
start
)
/
time
.
Second
,
len
(
scheduled
)
-
prev
,
len
(
scheduled
))
if
len
(
scheduled
)
>=
numPods
{
if
len
(
scheduled
)
>=
numPods
{
return
return
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment