From 07037a4c2c5eb6c4d16a0714992f24738880c95b Mon Sep 17 00:00:00 2001 From: Raul Sevilla Date: Wed, 25 Oct 2023 14:40:40 +0200 Subject: [PATCH] Status codes Signed-off-by: Raul Sevilla --- containers/Containerfile | 2 +- pkg/runner/exec.go | 3 +++ pkg/runner/tools/hloader.go | 4 ++-- pkg/runner/tools/types.go | 1 + 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/containers/Containerfile b/containers/Containerfile index 2a97aec..8513e0b 100644 --- a/containers/Containerfile +++ b/containers/Containerfile @@ -7,4 +7,4 @@ FROM registry.access.redhat.com/ubi8/ubi:latest RUN dnf install -y iproute procps-ng COPY --from=builder /wrk/wrk /usr/bin/wrk COPY json.lua json.lua -COPY hloader /usr/bin/hloader +RUN curl -L -sS https://github.com/rsevilla87/hloader/releases/download/v0.1.0/hloader-Linux-v0.1.0-x86_64.tar.gz | tar xz -C /usr/bin/ diff --git a/pkg/runner/exec.go b/pkg/runner/exec.go index 5287d17..63ba0e3 100644 --- a/pkg/runner/exec.go +++ b/pkg/runner/exec.go @@ -189,6 +189,9 @@ func genResultSummary(result *tools.Result) { result.P90Latency += pod.P90Latency result.P95Latency += pod.P95Latency result.P99Latency += pod.P99Latency + for code, count := range pod.StatusCodes { + result.StatusCodes[code] += count + } } pods := float64(len(result.Pods)) result.StdevRps = result.StdevRps / pods diff --git a/pkg/runner/tools/hloader.go b/pkg/runner/tools/hloader.go index 236a5bb..bc314db 100644 --- a/pkg/runner/tools/hloader.go +++ b/pkg/runner/tools/hloader.go @@ -39,8 +39,8 @@ func HLoader(cfg config.Config, ep string) Tool { "-d", fmt.Sprint(cfg.Duration), "-r", strconv.Itoa(cfg.RequestRate), "-t", fmt.Sprint(cfg.RequestTimeout), - "-k", strconv.FormatBool(cfg.Keepalive), - "--http2", strconv.FormatBool(cfg.HTTP2), + fmt.Sprintf("--keepalive=%v", cfg.Keepalive), + fmt.Sprintf("--http2=%v", cfg.HTTP2), }, res: PodResult{}, } diff --git a/pkg/runner/tools/types.go b/pkg/runner/tools/types.go index 99dcf0e..0588d44 100644 --- a/pkg/runner/tools/types.go +++ b/pkg/runner/tools/types.go @@ -73,5 +73,6 @@ type Result struct { Requests int64 `json:"requests"` Timeouts int64 `json:"timeouts"` Version string `json:"version"` + StatusCodes map[int]int64 `json:"status_codes"` ClusterMetadata }