From 998c26f9c69504b387f34632e4040c90255456f2 Mon Sep 17 00:00:00 2001 From: VihasMakwana <121151420+VihasMakwana@users.noreply.github.com> Date: Sun, 3 Dec 2023 03:41:50 +0530 Subject: [PATCH] chore: minor enhancement Reuse `args` instead of creating new ones while running nighthawk. Signed-off-by: Vihas Makwana --- apinighthawk/nighthawk.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/apinighthawk/nighthawk.go b/apinighthawk/nighthawk.go index 9efdfc44..d7d4d2df 100644 --- a/apinighthawk/nighthawk.go +++ b/apinighthawk/nighthawk.go @@ -34,19 +34,14 @@ func NighthawkRun(config *NighthawkConfig) ([]byte, error) { args := []string{"--rps " + qps, "--connections " + c, + "--concurrency 1", "--duration " + duration, rURL.String(), "--output-format experimental_fortio_pedantic"} log.Info("Received arguments for run", args) - out, err := exec.Command("nighthawk_client", - "--rps "+qps, - "--concurrency 1", - "--connections "+c, - "--duration "+duration, - rURL.String(), - "--output-format experimental_fortio_pedantic").Output() + out, err := exec.Command("nighthawk_client", args...).Output() if err != nil { msg := "Unable to run load-test"