From d5b29bd0485f1eed3cf1dc3a7ec16fc45e92e674 Mon Sep 17 00:00:00 2001 From: vankichi Date: Tue, 16 Apr 2024 11:50:23 +0900 Subject: [PATCH] :bug: Fix build error and add comment Signed-off-by: vankichi --- pkg/tools/benchmark/job/usecase/benchmarkd.go | 6 ++++-- pkg/tools/benchmark/operator/service/operator.go | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pkg/tools/benchmark/job/usecase/benchmarkd.go b/pkg/tools/benchmark/job/usecase/benchmarkd.go index 6f8e26d772..b78a353a18 100644 --- a/pkg/tools/benchmark/job/usecase/benchmarkd.go +++ b/pkg/tools/benchmark/job/usecase/benchmarkd.go @@ -75,9 +75,11 @@ func New(cfg *config.Config) (r runner.Runner, err error) { if err != nil { return nil, err } - clientInterceptors = append(clientInterceptors, "metric"} + // Add interceptors regardless of whether it is set in config. + // Because it is the benchmark job and requires metrics for measure benchmark result. + clientInterceptors = append(clientInterceptors, "metric") if cfg.Observability.Trace.Enabled { - clientInterceptors = append(clientInterceptors, "trace"} + clientInterceptors = append(clientInterceptors, "trace") } } diff --git a/pkg/tools/benchmark/operator/service/operator.go b/pkg/tools/benchmark/operator/service/operator.go index 1d1e9accd2..438967f1fa 100644 --- a/pkg/tools/benchmark/operator/service/operator.go +++ b/pkg/tools/benchmark/operator/service/operator.go @@ -51,6 +51,8 @@ type scenario struct { const ( Scenario = "scenario" ScenarioKind = "ValdBenchmarkScenario" + Name = "name" + ServerName = "vald-benchmark-job" BenchmarkName = "benchmark-name" BeforeJobName = "before-job-name" BeforeJobNamespace = "before-job-namespace" @@ -472,6 +474,7 @@ func (o *operator) createBenchmarkJob(ctx context.Context, scenario v1.ValdBench // createJob creates benchmark job from benchmark job resource. func (o *operator) createJob(ctx context.Context, bjr v1.ValdBenchmarkJob) error { label := map[string]string{ + Name: ServerName, BenchmarkName: bjr.GetName() + strconv.Itoa(int(bjr.GetGeneration())), } job, err := benchjob.NewBenchmarkJob(