@@ -215,11 +215,27 @@ func runSysbench(ctx context.Context, t test.Test, c cluster.Cluster, opts sysbe
215
215
}
216
216
217
217
func registerSysbench (r registry.Registry ) {
218
- for w := sysbenchWorkload (0 ); w < numSysbenchWorkloads ; w ++ {
219
- for _ , n := range []int {1 , 3 } {
220
- const cpus = 32
221
- concPerCPU := n * 3 - 1
222
- conc := cpus * concPerCPU
218
+ for _ , d := range []struct {
219
+ n , cpus int
220
+ pick func (sysbenchWorkload ) bool // nil means true for all
221
+ }{
222
+ {n : 1 , cpus : 32 },
223
+ {n : 3 , cpus : 32 },
224
+ {n : 3 , cpus : 8 , pick : func (w sysbenchWorkload ) bool {
225
+ switch w {
226
+ case oltpReadOnly , oltpReadWrite , oltpWriteOnly :
227
+ return true
228
+ default :
229
+ return false
230
+ }
231
+ }},
232
+ } {
233
+ for w := sysbenchWorkload (0 ); w < numSysbenchWorkloads ; w ++ {
234
+ if d .pick != nil && ! d .pick (w ) {
235
+ continue
236
+ }
237
+ concPerCPU := d .n * 3 - 1
238
+ conc := d .cpus * concPerCPU
223
239
opts := sysbenchOptions {
224
240
workload : w ,
225
241
duration : 10 * time .Minute ,
@@ -229,10 +245,10 @@ func registerSysbench(r registry.Registry) {
229
245
}
230
246
231
247
r .Add (registry.TestSpec {
232
- Name : fmt .Sprintf ("sysbench/%s/nodes=%d/cpu=%d/conc=%d" , w , n , cpus , conc ),
248
+ Name : fmt .Sprintf ("sysbench/%s/nodes=%d/cpu=%d/conc=%d" , w , d . n , d . cpus , conc ),
233
249
Benchmark : true ,
234
250
Owner : registry .OwnerTestEng ,
235
- Cluster : r .MakeClusterSpec (n + 1 , spec .CPU (cpus ), spec .WorkloadNode (), spec .WorkloadNodeCPU (16 )),
251
+ Cluster : r .MakeClusterSpec (d . n + 1 , spec .CPU (d . cpus ), spec .WorkloadNode (), spec .WorkloadNodeCPU (16 )),
236
252
CompatibleClouds : registry .OnlyGCE ,
237
253
Suites : registry .Suites (registry .Nightly ),
238
254
Run : func (ctx context.Context , t test.Test , c cluster.Cluster ) {
@@ -241,14 +257,14 @@ func registerSysbench(r registry.Registry) {
241
257
})
242
258
243
259
// Add a variant of each test that uses PostgreSQL instead of CockroachDB.
244
- if n == 1 {
260
+ if d . n == 1 {
245
261
pgOpts := opts
246
262
pgOpts .usePostgres = true
247
263
r .Add (registry.TestSpec {
248
- Name : fmt .Sprintf ("sysbench/%s/postgres/cpu=%d/conc=%d" , w , cpus , conc ),
264
+ Name : fmt .Sprintf ("sysbench/%s/postgres/cpu=%d/conc=%d" , w , d . cpus , conc ),
249
265
Benchmark : true ,
250
266
Owner : registry .OwnerTestEng ,
251
- Cluster : r .MakeClusterSpec (n + 1 , spec .CPU (cpus ), spec .WorkloadNode (), spec .WorkloadNodeCPU (16 )),
267
+ Cluster : r .MakeClusterSpec (d . n + 1 , spec .CPU (d . cpus ), spec .WorkloadNode (), spec .WorkloadNodeCPU (16 )),
252
268
CompatibleClouds : registry .OnlyGCE ,
253
269
Suites : registry .ManualOnly ,
254
270
Run : func (ctx context.Context , t test.Test , c cluster.Cluster ) {
0 commit comments