diff --git a/Makefile b/Makefile index 3c5eaaf..f403678 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ BIN_NAME = ingress-perf BIN_PATH = $(BIN_DIR)/$(BIN_NAME) SOURCES = $(shell find . -type f -name "*.go") CGO = 0 -VEGETA_VERSION := 12.11.1 +VEGETA_VERSION := 12.9.0 .PHONY: build lint clean diff --git a/pkg/runner/exec.go b/pkg/runner/exec.go index 2d64db9..2424ea8 100644 --- a/pkg/runner/exec.go +++ b/pkg/runner/exec.go @@ -41,20 +41,10 @@ func runBenchmark(cfg config.Config, clusterMetadata tools.ClusterMetadata) ([]t var benchmarkResult []tools.Result var clientPods []corev1.Pod var ep string - var tool tools.Tool r, err := orClientSet.RouteV1().Routes(benchmarkNs).Get(context.TODO(), fmt.Sprintf("%s-%s", serverName, cfg.Termination), metav1.GetOptions{}) if err != nil { return benchmarkResult, err } - if cfg.Termination == "http" { - ep = fmt.Sprintf("http://%v%v", r.Spec.Host, cfg.Path) - } else { - ep = fmt.Sprintf("https://%v%v", r.Spec.Host, cfg.Path) - } - tool, err = tools.New(cfg, ep) - if err != nil { - return benchmarkResult, err - } allClientPods, err := clientSet.CoreV1().Pods(benchmarkNs).List(context.TODO(), metav1.ListOptions{ LabelSelector: fmt.Sprintf("app=%s", clientName), }) @@ -85,8 +75,17 @@ func runBenchmark(cfg config.Config, clusterMetadata tools.ClusterMetadata) ([]t for _, pod := range clientPods { for i := 0; i < cfg.Procs; i++ { func(p corev1.Pod) { - log.Debugf("Running %v in client pods", tool.Cmd()) errGroup.Go(func() error { + if cfg.Termination == "http" { + ep = fmt.Sprintf("http://%v%v", r.Spec.Host, cfg.Path) + } else { + ep = fmt.Sprintf("https://%v%v", r.Spec.Host, cfg.Path) + } + tool, err := tools.New(cfg, ep) + if err != nil { + return err + } + log.Debugf("Running %v in client pods", tool.Cmd()) return exec(context.TODO(), tool, p, &result) }) }(pod)