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
e256c28b
Commit
e256c28b
authored
Dec 07, 2017
by
Jonathan Basseri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert scheduler_perf tests to use subtest.
Combine four separate tests into a table-driven test that uses subtests to logically organize the tests.
parent
f875ee59
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
22 deletions
+14
-22
scheduler_bench_test.go
test/integration/scheduler_perf/scheduler_bench_test.go
+14
-22
No files found.
test/integration/scheduler_perf/scheduler_bench_test.go
View file @
e256c28b
...
@@ -17,6 +17,7 @@ limitations under the License.
...
@@ -17,6 +17,7 @@ limitations under the License.
package
benchmark
package
benchmark
import
(
import
(
"fmt"
"testing"
"testing"
"time"
"time"
...
@@ -27,28 +28,19 @@ import (
...
@@ -27,28 +28,19 @@ import (
"github.com/golang/glog"
"github.com/golang/glog"
)
)
// BenchmarkScheduling100Nodes0Pods benchmarks the scheduling rate
// BenchmarkScheduling benchmarks the scheduling rate when the cluster has
// when the cluster has 100 nodes and 0 scheduled pods
// various quantities of nodes and scheduled pods.
func
BenchmarkScheduling100Nodes0Pods
(
b
*
testing
.
B
)
{
func
BenchmarkScheduling
(
b
*
testing
.
B
)
{
benchmarkScheduling
(
100
,
0
,
b
)
tests
:=
[]
struct
{
nodes
,
pods
int
}{
}
{
nodes
:
100
,
pods
:
0
},
{
nodes
:
100
,
pods
:
1000
},
// BenchmarkScheduling100Nodes1000Pods benchmarks the scheduling rate
{
nodes
:
1000
,
pods
:
0
},
// when the cluster has 100 nodes and 1000 scheduled pods
{
nodes
:
1000
,
pods
:
1000
},
func
BenchmarkScheduling100Nodes1000Pods
(
b
*
testing
.
B
)
{
}
benchmarkScheduling
(
100
,
1000
,
b
)
for
_
,
test
:=
range
tests
{
}
name
:=
fmt
.
Sprintf
(
"%vNodes/%vPods"
,
test
.
nodes
,
test
.
pods
)
b
.
Run
(
name
,
func
(
b
*
testing
.
B
)
{
benchmarkScheduling
(
test
.
nodes
,
test
.
pods
,
b
)
})
// BenchmarkScheduling1000Nodes0Pods benchmarks the scheduling rate
}
// when the cluster has 1000 nodes and 0 scheduled pods
func
BenchmarkScheduling1000Nodes0Pods
(
b
*
testing
.
B
)
{
benchmarkScheduling
(
1000
,
0
,
b
)
}
// BenchmarkScheduling1000Nodes1000Pods benchmarks the scheduling rate
// when the cluster has 1000 nodes and 1000 scheduled pods
func
BenchmarkScheduling1000Nodes1000Pods
(
b
*
testing
.
B
)
{
benchmarkScheduling
(
1000
,
1000
,
b
)
}
}
// benchmarkScheduling benchmarks scheduling rate with specific number of nodes
// benchmarkScheduling benchmarks scheduling rate with specific number of nodes
...
...
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