diff --git a/cmd/ingress-perf.go b/cmd/ingress-perf.go index e05967a..077423d 100644 --- a/cmd/ingress-perf.go +++ b/cmd/ingress-perf.go @@ -23,7 +23,6 @@ import ( _ "github.com/cloud-bulldozer/ingress-perf/pkg/log" "github.com/cloud-bulldozer/ingress-perf/pkg/runner" uid "github.com/satori/go.uuid" - "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus" "github.com/spf13/cobra" ) @@ -54,11 +53,11 @@ func run() *cobra.Command { SilenceUsage: true, SilenceErrors: true, PreRunE: func(cmd *cobra.Command, args []string) error { - lvl, err := logrus.ParseLevel(logLevel) + lvl, err := log.ParseLevel(logLevel) if err != nil { return err } - logrus.SetLevel(lvl) + log.SetLevel(lvl) return nil }, RunE: func(cmd *cobra.Command, args []string) error { diff --git a/pkg/runner/exec.go b/pkg/runner/exec.go index e07ad3d..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), }) @@ -86,6 +76,16 @@ func runBenchmark(cfg config.Config, clusterMetadata tools.ClusterMetadata) ([]t for i := 0; i < cfg.Procs; i++ { func(p corev1.Pod) { 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)