Skip to content

Commit 78e2a2e

Browse files
craig[bot]csgourav
andcommitted
Merge #143975
143975: roachtest/sysbench: Fix labels passed in aggregated metrics r=sambhav-jain-16 a=csgourav Fix the labels being passed to aggregated metrics in sysbench Fixes: none Epic: none Co-authored-by: Gourav Kumar <[email protected]>
2 parents d53e88e + 23df458 commit 78e2a2e

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

pkg/cmd/roachtest/roachtestutil/metric_utils.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ func processMetricLine(line string, metric *HistogramSummaryMetricPoint) ([]*Lab
433433
return nil, errors.New("error parsing metric line")
434434
}
435435

436-
labels, err := getLabels(matches[2])
436+
labels, err := GetLabels(matches[2])
437437
if err != nil {
438438
return nil, err
439439
}
@@ -478,7 +478,7 @@ func processMetricLine(line string, metric *HistogramSummaryMetricPoint) ([]*Lab
478478
return labels, nil
479479
}
480480

481-
func getLabels(labels string) ([]*Label, error) {
481+
func GetLabels(labels string) ([]*Label, error) {
482482
labelSlice := strings.Split(labels, ",")
483483
var finalLabels []*Label
484484

pkg/cmd/roachtest/tests/sysbench.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,10 +570,14 @@ func exportSysbenchResults(
570570

571571
aggregatedBuf := &bytes.Buffer{}
572572

573+
labels, err := roachtestutil.GetLabels(labelString)
574+
if err != nil {
575+
return errors.Wrap(err, "failed to get labels")
576+
}
573577
// Convert aggregated metrics to OpenMetrics format
574578
if err := roachtestutil.GetAggregatedMetricBytes(
575579
aggregatedMetrics,
576-
[]*roachtestutil.Label{{Name: "test", Value: t.Name()}},
580+
labels,
577581
timeutil.Now(),
578582
aggregatedBuf,
579583
); err != nil {

0 commit comments

Comments
 (0)