Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a benchmark testcase for measuring the time of creating pod and a container #419

Merged
merged 3 commits into from
Jan 24, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
benchmark: expand the timeout from 2 to 5 for creating a pod
For some hypervisor based containers, it would take much longer
time to create a pod, thus it's better expand the tiemout value
from 2 to 5 to avoid timeout errors.

Signed-off-by: Fupan Li <lifupan@gmail.com>
  • Loading branch information
lifupan committed Dec 21, 2018
commit 5f1025698c0e24a26c0c2b0e529d3d0f82ebad66
10 changes: 5 additions & 5 deletions pkg/benchmark/pod.go
Original file line number Diff line number Diff line change
@@ -58,28 +58,28 @@ var _ = framework.KubeDescribe("PodSandbox", func() {
})

framework.ExpectNoError(err, "failed to create PodSandbox: %v", err)
Expect(operation.Seconds()).Should(BeNumerically("<", 2), "create PodSandbox shouldn't take too long.")
Expect(operation.Seconds()).Should(BeNumerically("<", 5), "create PodSandbox shouldn't take too long.")

operation = b.Time("PodSandbox status", func() {
_, err = c.PodSandboxStatus(podID)
})

framework.ExpectNoError(err, "failed to get PodSandbox status: %v", err)
Expect(operation.Seconds()).Should(BeNumerically("<", 2), "get PodSandbox status shouldn't take too long.")
Expect(operation.Seconds()).Should(BeNumerically("<", 5), "get PodSandbox status shouldn't take too long.")

operation = b.Time("stop PodSandbox", func() {
err = c.StopPodSandbox(podID)
})

framework.ExpectNoError(err, "failed to stop PodSandbox: %v", err)
Expect(operation.Seconds()).Should(BeNumerically("<", 2), "stop PodSandbox shouldn't take too long.")
Expect(operation.Seconds()).Should(BeNumerically("<", 5), "stop PodSandbox shouldn't take too long.")

operation = b.Time("remove PodSandbox", func() {
c.RemovePodSandbox(podID)
})

framework.ExpectNoError(err, "failed to remove PodSandbox: %v", err)
Expect(operation.Seconds()).Should(BeNumerically("<", 2), "remove PodSandbox shouldn't take too long.")
Expect(operation.Seconds()).Should(BeNumerically("<", 5), "remove PodSandbox shouldn't take too long.")
}, defaultOperationTimes)

Measure("benchmark about listing PodSandbox", func(b Benchmarker) {
@@ -96,7 +96,7 @@ var _ = framework.KubeDescribe("PodSandbox", func() {
})

framework.ExpectNoError(err, "failed to list PodSandbox: %v", err)
Expect(operation.Seconds()).Should(BeNumerically("<", 2), "list PodSandbox shouldn't take too long.")
Expect(operation.Seconds()).Should(BeNumerically("<", 5), "list PodSandbox shouldn't take too long.")

for _, podID := range podList {
c.StopPodSandbox(podID)