From 183a6efe71b2d14f6338b079535cb18e1265166f Mon Sep 17 00:00:00 2001 From: Harshit Nagpal Date: Thu, 5 Sep 2024 11:36:35 +0530 Subject: [PATCH 1/3] Update tools/load-generator/main.go Co-authored-by: Ben Kochie Signed-off-by: Harshit Nagpal --- tools/load-generator/main.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/tools/load-generator/main.go b/tools/load-generator/main.go index 4c94d0b33..6d1de0b11 100644 --- a/tools/load-generator/main.go +++ b/tools/load-generator/main.go @@ -221,9 +221,6 @@ func main() { for i, group := range config.Querier.Groups { wg.Add(1) go NewQuerier(i, "pr", prNumber, group).run(&wg) - } - - for i, group := range config.Querier.Groups { wg.Add(1) go NewQuerier(i, "release", prNumber, group).run(&wg) } From c22e2ad53e0fe85bd5e8ba1ae0ac43042dca5f1e Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Fri, 20 Sep 2024 18:09:55 +0100 Subject: [PATCH 2/3] load-generator: Avoid crashing on empty duration string Instant queries typically have empty start and end times. Also use Prometheus ParseDuration to give more flexibility. Signed-off-by: Bryan Boreham --- tools/load-generator/main.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tools/load-generator/main.go b/tools/load-generator/main.go index 6d1de0b11..410c4bdc2 100644 --- a/tools/load-generator/main.go +++ b/tools/load-generator/main.go @@ -24,6 +24,7 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" + "github.com/prometheus/common/model" "gopkg.in/yaml.v2" ) @@ -184,12 +185,14 @@ func (q *Querier) query(expr string) { } func durationSeconds(s string) time.Duration { - num := s[:len(s)-1] - value, err := time.ParseDuration(num + string(s[len(s)-1])) + if s == "" { + return 0 + } + value, err := model.ParseDuration(s) if err != nil { - log.Fatalf("Invalid duration: %s", s) + log.Fatalf("%s", err.Error()) } - return value + return time.Duration(value) } func main() { From 58a195b0b8249cdd746b32bdccf5a74ae6d8dfe9 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Fri, 20 Sep 2024 18:16:13 +0100 Subject: [PATCH 3/3] Revert change to 6_loadgen.yaml Signed-off-by: Bryan Boreham --- .../prombench/benchmark/6_loadgen.yaml | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/prombench/manifests/prombench/benchmark/6_loadgen.yaml b/prombench/manifests/prombench/benchmark/6_loadgen.yaml index 69f214136..0c3b4d6ff 100644 --- a/prombench/manifests/prombench/benchmark/6_loadgen.yaml +++ b/prombench/manifests/prombench/benchmark/6_loadgen.yaml @@ -48,25 +48,6 @@ data: - expr: histogram_quantile(0.99, sum by(path, le) (rate(codelab_api_request_duration_seconds_bucket{method="POST"}[5m]))) - expr: histogram_quantile(0.99, sum by(path, method, le) (rate(codelab_api_request_duration_seconds_bucket{method="POST"}[5m]))) - expr: histogram_quantile(0.99, sum by(instance, le) (rate(codelab_api_request_duration_seconds_bucket{method="POST"}[5m]))) - - name: binary_arithmetic_operators - interval: 15s - type: instant - queries: - - expr: sum(node_memory_MemAvailable_bytes) / sum(node_memory_MemTotal_bytes) - - expr: rate(node_network_transmit_bytes_total[5m]) * 8 - - expr: node_filesystem_avail_bytes / node_filesystem_size_bytes - - name: logical_operators - interval: 15s - type: instant - queries: - - expr: rate(node_cpu_seconds_total{mode="system"}[5m]) and rate(node_cpu_seconds_total{mode="user"}[5m]) - - expr: node_filesystem_avail_bytes unless node_filesystem_size_bytes - - expr: rate(node_network_receive_bytes_total[5m]) or rate(node_network_transmit_bytes_total[5m]) - - name: topk_example - interval: 15s - type: instant - queries: - - expr: topk(5, rate(http_requests_total[5m])) --- apiVersion: apps/v1 kind: Deployment