File tree 6 files changed +16
-3
lines changed
6 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -116,7 +116,9 @@ func registerCHBenchmark(root *cobra.Command) {
116
116
}
117
117
118
118
func executeCH (action string , openAP func () (* sql.DB , error )) {
119
- runtime .GOMAXPROCS (maxProcs )
119
+ if maxProcs == 0 {
120
+ runtime .GOMAXPROCS (maxProcs )
121
+ }
120
122
121
123
openDB ()
122
124
defer closeDB ()
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ import (
17
17
18
18
"github.com/pingcap/go-tpc/pkg/util"
19
19
"github.com/spf13/cobra"
20
-
20
+ _ "go.uber.org/automaxprocs"
21
21
// mysql package
22
22
"github.com/go-sql-driver/mysql"
23
23
// pg
Original file line number Diff line number Diff line change @@ -39,7 +39,9 @@ func executeTpcc(action string) {
39
39
}
40
40
}()
41
41
}
42
- runtime .GOMAXPROCS (maxProcs )
42
+ if maxProcs == 0 {
43
+ runtime .GOMAXPROCS (maxProcs )
44
+ }
43
45
44
46
openDB ()
45
47
defer closeDB ()
Original file line number Diff line number Diff line change 4
4
"context"
5
5
"fmt"
6
6
"os"
7
+ "runtime"
7
8
"strings"
8
9
9
10
"github.com/pingcap/go-tpc/pkg/util"
@@ -21,6 +22,9 @@ func executeTpch(action string) {
21
22
util .StdErrLogger .Printf ("cannot connect to the database" )
22
23
os .Exit (1 )
23
24
}
25
+ if maxProcs == 0 {
26
+ runtime .GOMAXPROCS (maxProcs )
27
+ }
24
28
25
29
tpchConfig .PlanReplayerConfig .Host = hosts [0 ]
26
30
tpchConfig .PlanReplayerConfig .StatusPort = statusPort
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ require (
12
12
github.com/spf13/cobra v1.0.0
13
13
github.com/stretchr/testify v1.8.0
14
14
go.uber.org/atomic v1.9.0
15
+ go.uber.org/automaxprocs v1.5.3
15
16
golang.org/x/sync v0.1.0
16
17
)
17
18
Original file line number Diff line number Diff line change @@ -300,6 +300,8 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE
300
300
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM =
301
301
github.com/pmezard/go-difflib v1.0.0 /go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4 =
302
302
github.com/posener/complete v1.1.1 /go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI =
303
+ github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g =
304
+ github.com/prashantv/gostub v1.1.0 /go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U =
303
305
github.com/prometheus/client_golang v0.9.1 /go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw =
304
306
github.com/prometheus/client_golang v0.9.3 /go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso =
305
307
github.com/prometheus/client_golang v1.15.0 h1:5fCgGYogn0hFdhyhLbw7hEsWxufKtY9klyvdNfFlFhM =
@@ -409,6 +411,8 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
409
411
go.uber.org/atomic v1.4.0 /go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE =
410
412
go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE =
411
413
go.uber.org/atomic v1.9.0 /go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc =
414
+ go.uber.org/automaxprocs v1.5.3 h1:kWazyxZUrS3Gs4qUpbwo5kEIMGe/DAvi5Z4tl2NW4j8 =
415
+ go.uber.org/automaxprocs v1.5.3 /go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0 =
412
416
go.uber.org/multierr v1.1.0 /go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0 =
413
417
go.uber.org/zap v1.10.0 /go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q =
414
418
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793 /go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4 =
You can’t perform that action at this time.
0 commit comments