diff --git a/pkg/benchmark/container.go b/pkg/benchmark/container.go index 781d685bce..e7d41fce92 100644 --- a/pkg/benchmark/container.go +++ b/pkg/benchmark/container.go @@ -17,6 +17,7 @@ limitations under the License. package benchmark import ( + "fmt" "path" "time" @@ -85,35 +86,35 @@ var _ = framework.KubeDescribe("Container", func() { podID, podConfig = framework.CreatePodSandboxForContainer(rc) - By("CreatingContainer") + By(fmt.Sprintf("CreatingContainer %d", idx)) startTime := time.Now().UnixNano() lastStartTime = startTime containerID = framework.CreateDefaultContainer(rc, ic, podID, podConfig, "Benchmark-container-") lastEndTime = time.Now().UnixNano() durations[0] = lastEndTime - lastStartTime - By("StartingContainer") + By(fmt.Sprintf("StartingContainer %d", idx)) lastStartTime = time.Now().UnixNano() err = rc.StartContainer(containerID) lastEndTime = time.Now().UnixNano() durations[1] = lastEndTime - lastStartTime framework.ExpectNoError(err, "failed to start Container: %v", err) - By("ContainerStatus") + By(fmt.Sprintf("ContainerStatus %d", idx)) lastStartTime = time.Now().UnixNano() _, err = rc.ContainerStatus(containerID, true) lastEndTime = time.Now().UnixNano() durations[2] = lastEndTime - lastStartTime framework.ExpectNoError(err, "failed to get Container status: %v", err) - By("ContainerStop") + By(fmt.Sprintf("ContainerStop %d", idx)) lastStartTime = time.Now().UnixNano() err = rc.StopContainer(containerID, framework.DefaultStopContainerTimeout) lastEndTime = time.Now().UnixNano() durations[3] = lastEndTime - lastStartTime framework.ExpectNoError(err, "failed to stop Container: %v", err) - By("ContainerRemove") + By(fmt.Sprintf("ContainerRemove %d", idx)) lastStartTime = time.Now().UnixNano() err = rc.RemoveContainer(containerID) lastEndTime = time.Now().UnixNano() @@ -129,9 +130,9 @@ var _ = framework.KubeDescribe("Container", func() { } resultsChannel <- &res - By("stop PodSandbox") + By(fmt.Sprintf("stop PodSandbox %d", idx)) rc.StopPodSandbox(podID) - By("delete PodSandbox") + By(fmt.Sprintf("delete PodSandbox %d", idx)) rc.RemovePodSandbox(podID) }, samplingConfig) diff --git a/pkg/benchmark/image.go b/pkg/benchmark/image.go index ee84ee7dc0..4b2ec4fa08 100644 --- a/pkg/benchmark/image.go +++ b/pkg/benchmark/image.go @@ -17,6 +17,7 @@ limitations under the License. package benchmark import ( + "fmt" "path" "runtime" "time" @@ -124,21 +125,21 @@ var _ = framework.KubeDescribe("Image", func() { Image: imagePullingBenchmarkImage, } - By("Pull Image") + By(fmt.Sprintf("Pull Image %d", idx)) startTime := time.Now().UnixNano() lastStartTime = startTime imageId := framework.PullPublicImage(ic, imagePullingBenchmarkImage, nil) lastEndTime = time.Now().UnixNano() durations[0] = lastEndTime - lastStartTime - By("Status Image") + By(fmt.Sprintf("Status Image %d", idx)) lastStartTime = startTime _, err = ic.ImageStatus(imageSpec, false) lastEndTime = time.Now().UnixNano() durations[1] = lastEndTime - lastStartTime framework.ExpectNoError(err, "failed to status Image: %v", err) - By("Remove Image") + By(fmt.Sprintf("Remove Image %d", idx)) lastStartTime = startTime err = ic.RemoveImage(imageSpec) lastEndTime = time.Now().UnixNano() @@ -212,7 +213,7 @@ var _ = framework.KubeDescribe("Image", func() { var err error durations := make([]int64, len(imageListResultsSet.OperationsNames)) - By("List Images") + By(fmt.Sprintf("List Images %d", idx)) startTime := time.Now().UnixNano() _, err = ic.ListImages(nil) endTime := time.Now().UnixNano() diff --git a/pkg/benchmark/pod.go b/pkg/benchmark/pod.go index 7caf9b5794..6d6f9c034b 100644 --- a/pkg/benchmark/pod.go +++ b/pkg/benchmark/pod.go @@ -17,6 +17,7 @@ limitations under the License. package benchmark import ( + "fmt" "path" "time" @@ -90,7 +91,7 @@ var _ = framework.KubeDescribe("PodSandbox", func() { Labels: framework.DefaultPodLabels, } - By("Creating a pod") + By(fmt.Sprintf("Creating a pod %d", idx)) startTime := time.Now().UnixNano() lastStartTime = startTime podID, err = c.RunPodSandbox(config, framework.TestContext.RuntimeHandler) @@ -98,21 +99,21 @@ var _ = framework.KubeDescribe("PodSandbox", func() { durations[0] = lastEndTime - lastStartTime framework.ExpectNoError(err, "failed to create PodSandbox: %v", err) - By("Get Pod status") + By(fmt.Sprintf("Get Pod status %d", idx)) lastStartTime = time.Now().UnixNano() _, err = c.PodSandboxStatus(podID, true) lastEndTime = time.Now().UnixNano() durations[1] = lastEndTime - lastStartTime framework.ExpectNoError(err, "failed to get PodStatus: %v", err) - By("Stop PodSandbox") + By(fmt.Sprintf("Stop PodSandbox %d", idx)) lastStartTime = time.Now().UnixNano() err = c.StopPodSandbox(podID) lastEndTime = time.Now().UnixNano() durations[2] = lastEndTime - lastStartTime framework.ExpectNoError(err, "failed to stop PodSandbox: %v", err) - By("Remove PodSandbox") + By(fmt.Sprintf("Remove PodSandbox %d", idx)) lastStartTime = time.Now().UnixNano() err = c.RemovePodSandbox(podID) lastEndTime = time.Now().UnixNano()