Skip to content

Commit 16ddb97

Browse files
committed
roachtest/cdcbench: generate aggregate stats for cdc/scan tests
Adds aggregate metric for cdc/scan tests. Adds one missing warehouse label in tpcc test. Epic: none Fixes: none
1 parent 8b29e48 commit 16ddb97

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

pkg/cmd/roachtest/tests/cdc_bench.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,26 @@ func registerCDCBench(r registry.Registry) {
9292
Run: func(ctx context.Context, t test.Test, c cluster.Cluster) {
9393
runCDCBenchScan(ctx, t, c, scanType, rows, ranges, format)
9494
},
95+
PostProcessPerfMetrics: func(testName string, histograms *roachtestutil.HistogramMetric) (roachtestutil.AggregatedPerfMetrics, error) {
96+
metrics := roachtestutil.AggregatedPerfMetrics{}
97+
98+
// Find the scan-rate summary
99+
var scanRate float64
100+
if len(histograms.Summaries) != 1 {
101+
return nil, errors.Errorf("expected exactly 1 histogram summary, got %d", len(histograms.Summaries))
102+
}
103+
scanRate = float64(histograms.Summaries[0].HighestTrackableValue) / float64(time.Second)
104+
105+
// Add scan rate metric (higher is better)
106+
metrics = append(metrics, &roachtestutil.AggregatedMetric{
107+
Name: "scan_rate",
108+
Value: roachtestutil.MetricPoint(scanRate),
109+
Unit: "rows/s",
110+
IsHigherBetter: true,
111+
})
112+
113+
return metrics, nil
114+
},
95115
})
96116
}
97117
}

pkg/cmd/roachtest/tests/tpcc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ func getMaxWarehousesAboveEfficiency(
163163
aggregatedMetrics = append(aggregatedMetrics, &roachtestutil.AggregatedMetric{
164164
Name: fmt.Sprintf("%s_max_warehouse", testName),
165165
Value: roachtestutil.MetricPoint(maxEfficientWarehouse),
166-
Unit: "",
166+
Unit: "warehouses",
167167
IsHigherBetter: true,
168168
// labels added here override any labels imported from the stats file.
169169
// since we don't want to specify a warehouse label for this metric, we pass an empty label.

0 commit comments

Comments
 (0)