From 18ce2b56ec1ccb76df4c29b84a60429974765b2b Mon Sep 17 00:00:00 2001 From: Daniel Hrabovcak Date: Thu, 28 Sep 2023 17:19:30 -0400 Subject: [PATCH] Fix bench library error --- pkg/export/bench/README.md | 2 +- pkg/export/bench/{ => app}/example_app.go | 6 +++--- pkg/export/bench/run.sh | 2 +- pkg/export/bench/server.go | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) rename pkg/export/bench/{ => app}/example_app.go (99%) diff --git a/pkg/export/bench/README.md b/pkg/export/bench/README.md index 55e355b352..f0b76f921c 100644 --- a/pkg/export/bench/README.md +++ b/pkg/export/bench/README.md @@ -18,7 +18,7 @@ load broad coverage of potential race conditions, which will be logged. ## Resource usage -The Prometheus server scrapse itself, which allows gauging the resource usage of the Prometheus +The Prometheus server scrapes itself, which allows gauging the resource usage of the Prometheus binary as well as the overhead relative to a regular Prometheus server. The example app allows tweaking its flags to expose more or fewer metrics. Lowering the scrape diff --git a/pkg/export/bench/example_app.go b/pkg/export/bench/app/example_app.go similarity index 99% rename from pkg/export/bench/example_app.go rename to pkg/export/bench/app/example_app.go index 7e58b34c03..eec98289ce 100644 --- a/pkg/export/bench/example_app.go +++ b/pkg/export/bench/app/example_app.go @@ -45,19 +45,19 @@ var ( var ( availableLabels = map[string][]string{ - "method": []string{ + "method": { "POST", "PUT", "GET", }, - "status": []string{ + "status": { "200", "300", "400", "404", "500", }, - "path": []string{ + "path": { "/", "/index", "/topics", diff --git a/pkg/export/bench/run.sh b/pkg/export/bench/run.sh index fb06381757..2e3582e5cb 100755 --- a/pkg/export/bench/run.sh +++ b/pkg/export/bench/run.sh @@ -31,7 +31,7 @@ rm -rf data1 data2 data3 echo "Starting example metrics application" -go run example_app.go 2>&1 | sed -e "s/^/[example-app] /" & +go run app/example_app.go 2>&1 | sed -e "s/^/[example-app] /" & echo "Starting fake GCM endpoint" diff --git a/pkg/export/bench/server.go b/pkg/export/bench/server.go index 2dce9bc67f..db9cd94aab 100644 --- a/pkg/export/bench/server.go +++ b/pkg/export/bench/server.go @@ -23,10 +23,10 @@ import ( _ "net/http/pprof" // Comment this line to disable pprof endpoint. "time" + monitoring_pb "cloud.google.com/go/monitoring/apiv3/v2/monitoringpb" "github.com/golang/protobuf/ptypes/empty" grpc_prometheus "github.com/grpc-ecosystem/go-grpc-prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" - monitoring_pb "google.golang.org/genproto/googleapis/monitoring/v3" "google.golang.org/grpc" )