mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 21:47:07 +00:00
Merge pull request #64363 from idealhack/sub-benchmarks/scheduler/schedulercache
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. scheduler: update tests to use sub-benchmarks (pkg/scheduler/cache) **What this PR does / why we need it**: Go 1.7 added the subtest feature which can make table-driven tests much easier to run and debug. Some tests are not using this feature. Further reading: [Using Subtests and Sub-benchmarks](https://blog.golang.org/subtests) /kind cleanup **Release note**: ```release-note NONE ```
This commit is contained in:
commit
f2db955b9d
22
pkg/scheduler/cache/cache_test.go
vendored
22
pkg/scheduler/cache/cache_test.go
vendored
@ -1128,16 +1128,18 @@ func BenchmarkUpdate1kNodes30kPods(b *testing.B) {
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkExpire100Pods(b *testing.B) {
|
||||
benchmarkExpire(b, 100)
|
||||
}
|
||||
|
||||
func BenchmarkExpire1kPods(b *testing.B) {
|
||||
benchmarkExpire(b, 1000)
|
||||
}
|
||||
|
||||
func BenchmarkExpire10kPods(b *testing.B) {
|
||||
benchmarkExpire(b, 10000)
|
||||
func BenchmarkExpirePods(b *testing.B) {
|
||||
podNums := []int{
|
||||
100,
|
||||
1000,
|
||||
10000,
|
||||
}
|
||||
for _, podNum := range podNums {
|
||||
name := fmt.Sprintf("%dPods", podNum)
|
||||
b.Run(name, func(b *testing.B) {
|
||||
benchmarkExpire(b, podNum)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func benchmarkExpire(b *testing.B, podNum int) {
|
||||
|
Loading…
Reference in New Issue
Block a user