@@ -1787,6 +1787,7 @@ func runMessageTooLarge(ctx context.Context, t test.Test, c cluster.Cluster) {
1787
1787
1788
1788
type multiTablePTSBenchmarkParams struct {
1789
1789
numTables int
1790
+ numRanges int
1790
1791
numRows int
1791
1792
duration string
1792
1793
}
@@ -1812,8 +1813,13 @@ func runCDCMultiTablePTSBenchmark(
1812
1813
t .Fatalf ("failed to set cluster settings: %v" , err )
1813
1814
}
1814
1815
1815
- initCmd := fmt .Sprintf ("./cockroach workload init bank --rows=%d --num-tables=%d {pgurl%s}" ,
1816
- params .numRows , params .numTables , ct .crdbNodes .RandNode ())
1816
+ numRanges := 10
1817
+ if params .numRanges > 0 {
1818
+ numRanges = params .numRanges
1819
+ }
1820
+
1821
+ initCmd := fmt .Sprintf ("./cockroach workload init bank --rows=%d --ranges=%d --num-tables=%d {pgurl%s}" ,
1822
+ params .numRows , numRanges , params .numTables , ct .crdbNodes .RandNode ())
1817
1823
if err := c .RunE (ctx , option .WithNodes (ct .workloadNode ), initCmd ); err != nil {
1818
1824
t .Fatalf ("failed to initialize bank tables: %v" , err )
1819
1825
}
@@ -1855,11 +1861,11 @@ func runCDCMultiTablePTSBenchmark(
1855
1861
t .Status ("workload finished, verifying metrics" )
1856
1862
1857
1863
// These metrics are in nanoseconds, so we are asserting that both
1858
- // of these latency metrics are less than 10 milliseconds.
1859
- ct .verifyMetrics (ctx , verifyMetricsUnderThreshold ([]string {
1864
+ // of these latency metrics are less than 25 milliseconds.
1865
+ ct .verifyMetrics (ctx , ct . verifyMetricsUnderThreshold ([]string {
1860
1866
"changefeed_stage_pts_manage_latency" ,
1861
1867
"changefeed_stage_pts_create_latency" ,
1862
- }, float64 (10 * time .Millisecond )))
1868
+ }, float64 (25 * time .Millisecond )))
1863
1869
1864
1870
t .Status ("multi-table PTS benchmark finished" )
1865
1871
}
@@ -2897,7 +2903,7 @@ func registerCDC(r registry.Registry) {
2897
2903
Run : runMessageTooLarge ,
2898
2904
})
2899
2905
r .Add (registry.TestSpec {
2900
- Name : "cdc/multi-table-pts-benchmark" ,
2906
+ Name : "cdc/multi-table-pts-benchmark/num-tables=500 " ,
2901
2907
Owner : registry .OwnerCDC ,
2902
2908
Benchmark : true ,
2903
2909
Cluster : r .MakeClusterSpec (4 , spec .CPU (16 ), spec .WorkloadNode ()),
@@ -2913,6 +2919,43 @@ func registerCDC(r registry.Registry) {
2913
2919
runCDCMultiTablePTSBenchmark (ctx , t , c , params )
2914
2920
},
2915
2921
})
2922
+ r .Add (registry.TestSpec {
2923
+ Name : "cdc/multi-table-pts-benchmark/num-tables=5000" ,
2924
+ Owner : registry .OwnerCDC ,
2925
+ Benchmark : true ,
2926
+ Cluster : r .MakeClusterSpec (4 , spec .CPU (16 ), spec .WorkloadNode ()),
2927
+ CompatibleClouds : registry .AllClouds ,
2928
+ Suites : registry .Suites (registry .Nightly ),
2929
+ Timeout : 1 * time .Hour ,
2930
+ Run : func (ctx context.Context , t test.Test , c cluster.Cluster ) {
2931
+ params := multiTablePTSBenchmarkParams {
2932
+ numTables : 5000 ,
2933
+ numRows : 100 ,
2934
+ duration : "20m" ,
2935
+ }
2936
+ runCDCMultiTablePTSBenchmark (ctx , t , c , params )
2937
+ },
2938
+ })
2939
+ r .Add (registry.TestSpec {
2940
+ Name : "cdc/multi-table-pts-benchmark/num-tables=50000" ,
2941
+ Owner : registry .OwnerCDC ,
2942
+ Benchmark : true ,
2943
+ Cluster : r .MakeClusterSpec (4 , spec .CPU (16 ), spec .WorkloadNode ()),
2944
+ CompatibleClouds : registry .AllClouds ,
2945
+ Suites : registry .Suites (registry .Nightly ),
2946
+ Timeout : 1 * time .Hour ,
2947
+ Run : func (ctx context.Context , t test.Test , c cluster.Cluster ) {
2948
+ params := multiTablePTSBenchmarkParams {
2949
+ numTables : 50_000 ,
2950
+ // Splitting tables into ranges slows down test setup at this scale.
2951
+ // Therefore, we don't split the tables into multiple ranges.
2952
+ numRanges : 1 ,
2953
+ numRows : 10 ,
2954
+ duration : "20m" ,
2955
+ }
2956
+ runCDCMultiTablePTSBenchmark (ctx , t , c , params )
2957
+ },
2958
+ })
2916
2959
}
2917
2960
2918
2961
const (
@@ -4598,7 +4641,7 @@ func verifyMetricsNonZero(names ...string) func(metrics map[string]*prompb.Metri
4598
4641
}
4599
4642
}
4600
4643
4601
- func verifyMetricsUnderThreshold (
4644
+ func ( ct * cdcTester ) verifyMetricsUnderThreshold (
4602
4645
names []string , threshold float64 ,
4603
4646
) func (metrics map [string ]* prompb.MetricFamily ) (ok bool ) {
4604
4647
namesMap := make (map [string ]struct {}, len (names ))
@@ -4622,6 +4665,8 @@ func verifyMetricsUnderThreshold(
4622
4665
observedValue := m .Histogram .GetSampleSum () / float64 (m .Histogram .GetSampleCount ())
4623
4666
if observedValue < threshold {
4624
4667
found [name ] = struct {}{}
4668
+ } else {
4669
+ ct .t .Fatalf ("observed value for metric %s over threshold. observedValue: %f, threshold: %f" , name , observedValue , threshold )
4625
4670
}
4626
4671
}
4627
4672
0 commit comments