diff --git a/.github/workflows/ci-sysbench-runner-tests.yaml b/.github/workflows/ci-sysbench-runner-tests.yaml index ea1ec9e5a1..0b2535f864 100644 --- a/.github/workflows/ci-sysbench-runner-tests.yaml +++ b/.github/workflows/ci-sysbench-runner-tests.yaml @@ -1,24 +1,24 @@ -name: Test Sysbench Runner Utility Works - -on: - pull_request: - branches: [ main ] - paths: - - 'go/**' - - 'integration-tests/**' - -concurrency: - group: ci-sysbench-runner-tests-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - mysql_client_integrations_job: - runs-on: ubuntu-22.04 - name: Test Sysbench Runner - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Copy Dockerfile - run: cp -r ./go/performance/continuous_integration/. . - - name: Test sysbench runner - uses: ./.github/actions/sysbench-runner-tests +#name: Test Sysbench Runner Utility Works +# +#on: +# pull_request: +# branches: [ main ] +# paths: +# - 'go/**' +# - 'integration-tests/**' +# +#concurrency: +# group: ci-sysbench-runner-tests-${{ github.event.pull_request.number || github.ref }} +# cancel-in-progress: true +# +#jobs: +# mysql_client_integrations_job: +# runs-on: ubuntu-22.04 +# name: Test Sysbench Runner +# steps: +# - name: Checkout +# uses: actions/checkout@v3 +# - name: Copy Dockerfile +# run: cp -r ./go/performance/continuous_integration/. . +# - name: Test sysbench runner +# uses: ./.github/actions/sysbench-runner-tests diff --git a/go/performance/utils/sysbench_runner/README.md b/go/performance/utils/benchmark_runner/README.md similarity index 92% rename from go/performance/utils/sysbench_runner/README.md rename to go/performance/utils/benchmark_runner/README.md index f5a02c9dc8..5d47db7395 100644 --- a/go/performance/utils/sysbench_runner/README.md +++ b/go/performance/utils/benchmark_runner/README.md @@ -1,11 +1,6 @@ Sysbench runner is a tool for running sysbench tests against sql servers. Custom sysbench lua scripts used for benchmarking Dolt are [here](https://github.com/dolthub/sysbench-lua-scripts). -The tool requires a json config file to run: -```bash -$ sysbench_runner --config=config.json -``` - Configuration: ```json @@ -62,8 +57,6 @@ oltp_update_non_index `Port` is the server port. Defaults to **3306** for `dolt` and `mysql` Servers. (**Optional**) -`Server` is the server. Only `dolt` and `mysql` are supported. (**Required**) - `Version` is the server version. (**Required**) `ResultsFormat` is the format the results should be written in. Only `json` and `csv` are supported. (**Required**) @@ -105,12 +98,6 @@ Note: Be sure that all mysql processes are off when running this locally. TPCC runner is a tool for running TPCC tests against sql servers. These tests run against the Percona Labs repo [here](https://github.com/Percona-Lab/sysbench-tpcc). -The tool requires a json config file to run. - -```bash -$ go run cmd/main.go --config=sample-tpcc-config.json -``` - Note to this run this locally you need to have the TPCC repo cloned. The `ScriptDir` variable should then be linked to the path of the cloned repo. diff --git a/go/performance/utils/benchmark_runner/benchmark.go b/go/performance/utils/benchmark_runner/benchmark.go new file mode 100644 index 0000000000..a255618074 --- /dev/null +++ b/go/performance/utils/benchmark_runner/benchmark.go @@ -0,0 +1,21 @@ +// Copyright 2019-2022 Dolthub, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package benchmark_runner + +import "context" + +type Benchmarker interface { + Benchmark(ctx context.Context) (Results, error) +} diff --git a/go/performance/utils/benchmark_runner/config.go b/go/performance/utils/benchmark_runner/config.go new file mode 100644 index 0000000000..477a5613c0 --- /dev/null +++ b/go/performance/utils/benchmark_runner/config.go @@ -0,0 +1,39 @@ +// Copyright 2019-2022 Dolthub, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package benchmark_runner + +import "context" + +type Config interface { + GetRuns() int + GetScriptDir() string + GetNomsBinFormat() string + GetRuntimeOs() string + GetRuntimeGoArch() string + GetServerConfigs() []ServerConfig + Validate(ctx context.Context) error + ContainsServerOfType(server ServerType) bool +} + +type SysbenchConfig interface { + Config + GetTestOptions() []string + GetTestConfigs() []TestConfig +} + +type TpccConfig interface { + Config + GetScaleFactors() []int +} diff --git a/go/performance/utils/sysbench_runner/constants.go b/go/performance/utils/benchmark_runner/constants.go similarity index 92% rename from go/performance/utils/sysbench_runner/constants.go rename to go/performance/utils/benchmark_runner/constants.go index 63440d37e2..389882e4be 100644 --- a/go/performance/utils/sysbench_runner/constants.go +++ b/go/performance/utils/benchmark_runner/constants.go @@ -1,4 +1,18 @@ -package sysbench_runner +// Copyright 2019-2022 Dolthub, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package benchmark_runner import "time" diff --git a/go/performance/utils/sysbench_runner/csv.go b/go/performance/utils/benchmark_runner/csv.go similarity index 99% rename from go/performance/utils/sysbench_runner/csv.go rename to go/performance/utils/benchmark_runner/csv.go index 44a445fe52..ba40ad66d0 100644 --- a/go/performance/utils/sysbench_runner/csv.go +++ b/go/performance/utils/benchmark_runner/csv.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package sysbench_runner +package benchmark_runner import ( "encoding/csv" diff --git a/go/performance/utils/sysbench_runner/csv_test.go b/go/performance/utils/benchmark_runner/csv_test.go similarity index 98% rename from go/performance/utils/sysbench_runner/csv_test.go rename to go/performance/utils/benchmark_runner/csv_test.go index 718c6a1b74..d530028828 100644 --- a/go/performance/utils/sysbench_runner/csv_test.go +++ b/go/performance/utils/benchmark_runner/csv_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package sysbench_runner +package benchmark_runner import ( "fmt" diff --git a/go/performance/utils/sysbench_runner/debug.go b/go/performance/utils/benchmark_runner/debug.go similarity index 97% rename from go/performance/utils/sysbench_runner/debug.go rename to go/performance/utils/benchmark_runner/debug.go index d51f2a0ad0..2671d42347 100644 --- a/go/performance/utils/sysbench_runner/debug.go +++ b/go/performance/utils/benchmark_runner/debug.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package sysbench_runner +package benchmark_runner import ( "context" diff --git a/go/performance/utils/sysbench_runner/dolt.go b/go/performance/utils/benchmark_runner/dolt.go similarity index 86% rename from go/performance/utils/sysbench_runner/dolt.go rename to go/performance/utils/benchmark_runner/dolt.go index 4aeb4ec929..ec333a4471 100644 --- a/go/performance/utils/sysbench_runner/dolt.go +++ b/go/performance/utils/benchmark_runner/dolt.go @@ -1,4 +1,18 @@ -package sysbench_runner +// Copyright 2019-2022 Dolthub, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package benchmark_runner import ( "context" diff --git a/go/performance/utils/sysbench_runner/dolt_server_config.go b/go/performance/utils/benchmark_runner/dolt_server_config.go similarity index 86% rename from go/performance/utils/sysbench_runner/dolt_server_config.go rename to go/performance/utils/benchmark_runner/dolt_server_config.go index 61840d0d31..6417fe3368 100644 --- a/go/performance/utils/sysbench_runner/dolt_server_config.go +++ b/go/performance/utils/benchmark_runner/dolt_server_config.go @@ -1,4 +1,18 @@ -package sysbench_runner +// Copyright 2019-2022 Dolthub, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package benchmark_runner import ( "fmt" diff --git a/go/performance/utils/sysbench_runner/dolt_tpcc.go b/go/performance/utils/benchmark_runner/dolt_tpcc.go similarity index 80% rename from go/performance/utils/sysbench_runner/dolt_tpcc.go rename to go/performance/utils/benchmark_runner/dolt_tpcc.go index 222129bd51..e8b57c9ed9 100644 --- a/go/performance/utils/sysbench_runner/dolt_tpcc.go +++ b/go/performance/utils/benchmark_runner/dolt_tpcc.go @@ -1,4 +1,18 @@ -package sysbench_runner +// Copyright 2019-2022 Dolthub, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package benchmark_runner import ( "context" diff --git a/go/performance/utils/sysbench_runner/doltgres.go b/go/performance/utils/benchmark_runner/doltgres.go similarity index 84% rename from go/performance/utils/sysbench_runner/doltgres.go rename to go/performance/utils/benchmark_runner/doltgres.go index b2dc6e9e08..be77c38cec 100644 --- a/go/performance/utils/sysbench_runner/doltgres.go +++ b/go/performance/utils/benchmark_runner/doltgres.go @@ -1,4 +1,18 @@ -package sysbench_runner +// Copyright 2019-2022 Dolthub, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package benchmark_runner import ( "context" diff --git a/go/performance/utils/sysbench_runner/doltgres_server_config.go b/go/performance/utils/benchmark_runner/doltgres_server_config.go similarity index 83% rename from go/performance/utils/sysbench_runner/doltgres_server_config.go rename to go/performance/utils/benchmark_runner/doltgres_server_config.go index e073f1be15..caa0af6833 100644 --- a/go/performance/utils/sysbench_runner/doltgres_server_config.go +++ b/go/performance/utils/benchmark_runner/doltgres_server_config.go @@ -1,4 +1,18 @@ -package sysbench_runner +// Copyright 2019-2022 Dolthub, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package benchmark_runner import ( "fmt" diff --git a/go/performance/utils/sysbench_runner/json.go b/go/performance/utils/benchmark_runner/json.go similarity index 98% rename from go/performance/utils/sysbench_runner/json.go rename to go/performance/utils/benchmark_runner/json.go index 389acd8c63..48270d1372 100644 --- a/go/performance/utils/sysbench_runner/json.go +++ b/go/performance/utils/benchmark_runner/json.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package sysbench_runner +package benchmark_runner import ( "encoding/json" diff --git a/go/performance/utils/sysbench_runner/json_test.go b/go/performance/utils/benchmark_runner/json_test.go similarity index 98% rename from go/performance/utils/sysbench_runner/json_test.go rename to go/performance/utils/benchmark_runner/json_test.go index c49b1b8d98..b3aaa1daba 100644 --- a/go/performance/utils/sysbench_runner/json_test.go +++ b/go/performance/utils/benchmark_runner/json_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package sysbench_runner +package benchmark_runner import ( "fmt" diff --git a/go/performance/utils/sysbench_runner/mysql.go b/go/performance/utils/benchmark_runner/mysql.go similarity index 85% rename from go/performance/utils/sysbench_runner/mysql.go rename to go/performance/utils/benchmark_runner/mysql.go index 1fa732a33e..2f096838da 100644 --- a/go/performance/utils/sysbench_runner/mysql.go +++ b/go/performance/utils/benchmark_runner/mysql.go @@ -1,4 +1,18 @@ -package sysbench_runner +// Copyright 2019-2022 Dolthub, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package benchmark_runner import ( "context" diff --git a/go/performance/utils/sysbench_runner/mysql_server_config.go b/go/performance/utils/benchmark_runner/mysql_server_config.go similarity index 86% rename from go/performance/utils/sysbench_runner/mysql_server_config.go rename to go/performance/utils/benchmark_runner/mysql_server_config.go index a5bdf3f516..b2cd4f5fa4 100644 --- a/go/performance/utils/sysbench_runner/mysql_server_config.go +++ b/go/performance/utils/benchmark_runner/mysql_server_config.go @@ -1,4 +1,18 @@ -package sysbench_runner +// Copyright 2019-2022 Dolthub, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package benchmark_runner import ( "fmt" diff --git a/go/performance/utils/sysbench_runner/mysql_tpcc.go b/go/performance/utils/benchmark_runner/mysql_tpcc.go similarity index 75% rename from go/performance/utils/sysbench_runner/mysql_tpcc.go rename to go/performance/utils/benchmark_runner/mysql_tpcc.go index ad88919db4..93d577e5dc 100644 --- a/go/performance/utils/sysbench_runner/mysql_tpcc.go +++ b/go/performance/utils/benchmark_runner/mysql_tpcc.go @@ -1,4 +1,18 @@ -package sysbench_runner +// Copyright 2019-2022 Dolthub, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package benchmark_runner import ( "context" diff --git a/go/performance/utils/sysbench_runner/postgres.go b/go/performance/utils/benchmark_runner/postgres.go similarity index 83% rename from go/performance/utils/sysbench_runner/postgres.go rename to go/performance/utils/benchmark_runner/postgres.go index c976c9cda8..dcbe4af522 100644 --- a/go/performance/utils/sysbench_runner/postgres.go +++ b/go/performance/utils/benchmark_runner/postgres.go @@ -1,4 +1,18 @@ -package sysbench_runner +// Copyright 2019-2022 Dolthub, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package benchmark_runner import ( "context" diff --git a/go/performance/utils/sysbench_runner/postgres_server_config.go b/go/performance/utils/benchmark_runner/postgres_server_config.go similarity index 84% rename from go/performance/utils/sysbench_runner/postgres_server_config.go rename to go/performance/utils/benchmark_runner/postgres_server_config.go index ffefa4cf7f..85d79d89e1 100644 --- a/go/performance/utils/sysbench_runner/postgres_server_config.go +++ b/go/performance/utils/benchmark_runner/postgres_server_config.go @@ -1,4 +1,18 @@ -package sysbench_runner +// Copyright 2019-2022 Dolthub, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package benchmark_runner import ( "fmt" diff --git a/go/performance/utils/sysbench_runner/profile.go b/go/performance/utils/benchmark_runner/profile.go similarity index 82% rename from go/performance/utils/sysbench_runner/profile.go rename to go/performance/utils/benchmark_runner/profile.go index 0a86a05ddf..53da1c0621 100644 --- a/go/performance/utils/sysbench_runner/profile.go +++ b/go/performance/utils/benchmark_runner/profile.go @@ -1,4 +1,18 @@ -package sysbench_runner +// Copyright 2019-2022 Dolthub, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package benchmark_runner import ( "context" diff --git a/go/performance/utils/sysbench_runner/results.go b/go/performance/utils/benchmark_runner/results.go similarity index 99% rename from go/performance/utils/sysbench_runner/results.go rename to go/performance/utils/benchmark_runner/results.go index a371706bda..9d7fed6be0 100644 --- a/go/performance/utils/sysbench_runner/results.go +++ b/go/performance/utils/benchmark_runner/results.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package sysbench_runner +package benchmark_runner import ( "errors" diff --git a/go/performance/utils/sysbench_runner/results_test.go b/go/performance/utils/benchmark_runner/results_test.go similarity index 99% rename from go/performance/utils/sysbench_runner/results_test.go rename to go/performance/utils/benchmark_runner/results_test.go index 072cdd831a..4ed9a64844 100644 --- a/go/performance/utils/sysbench_runner/results_test.go +++ b/go/performance/utils/benchmark_runner/results_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package sysbench_runner +package benchmark_runner import ( "fmt" diff --git a/go/performance/utils/sysbench_runner/run.go b/go/performance/utils/benchmark_runner/run.go similarity index 99% rename from go/performance/utils/sysbench_runner/run.go rename to go/performance/utils/benchmark_runner/run.go index 87426b56e8..a22964f41d 100644 --- a/go/performance/utils/sysbench_runner/run.go +++ b/go/performance/utils/benchmark_runner/run.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package sysbench_runner +package benchmark_runner import ( "context" diff --git a/go/performance/utils/sysbench_runner/run_test.go b/go/performance/utils/benchmark_runner/run_test.go similarity index 99% rename from go/performance/utils/sysbench_runner/run_test.go rename to go/performance/utils/benchmark_runner/run_test.go index ba038797da..ce66f4ab91 100644 --- a/go/performance/utils/sysbench_runner/run_test.go +++ b/go/performance/utils/benchmark_runner/run_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package sysbench_runner +package benchmark_runner import ( "context" diff --git a/go/performance/utils/sysbench_runner/run_tpcc.go b/go/performance/utils/benchmark_runner/run_tpcc.go similarity index 98% rename from go/performance/utils/sysbench_runner/run_tpcc.go rename to go/performance/utils/benchmark_runner/run_tpcc.go index 142a6cd4fe..10a3710ca8 100644 --- a/go/performance/utils/sysbench_runner/run_tpcc.go +++ b/go/performance/utils/benchmark_runner/run_tpcc.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package sysbench_runner +package benchmark_runner import ( "context" diff --git a/go/performance/utils/sysbench_runner/server.go b/go/performance/utils/benchmark_runner/server.go similarity index 80% rename from go/performance/utils/sysbench_runner/server.go rename to go/performance/utils/benchmark_runner/server.go index ee0aca4097..fbbca1f5c6 100644 --- a/go/performance/utils/sysbench_runner/server.go +++ b/go/performance/utils/benchmark_runner/server.go @@ -1,4 +1,18 @@ -package sysbench_runner +// Copyright 2019-2022 Dolthub, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package benchmark_runner import ( "context" diff --git a/go/performance/utils/sysbench_runner/server_config.go b/go/performance/utils/benchmark_runner/server_config.go similarity index 50% rename from go/performance/utils/sysbench_runner/server_config.go rename to go/performance/utils/benchmark_runner/server_config.go index a1581ac74c..37c02c41a7 100644 --- a/go/performance/utils/sysbench_runner/server_config.go +++ b/go/performance/utils/benchmark_runner/server_config.go @@ -1,4 +1,18 @@ -package sysbench_runner +// Copyright 2019-2022 Dolthub, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package benchmark_runner type ServerType string diff --git a/go/performance/utils/sysbench_runner/sysbench.go b/go/performance/utils/benchmark_runner/sysbench.go similarity index 85% rename from go/performance/utils/sysbench_runner/sysbench.go rename to go/performance/utils/benchmark_runner/sysbench.go index 69b1eccd3c..71ff223053 100644 --- a/go/performance/utils/sysbench_runner/sysbench.go +++ b/go/performance/utils/benchmark_runner/sysbench.go @@ -1,4 +1,18 @@ -package sysbench_runner +// Copyright 2019-2022 Dolthub, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package benchmark_runner import ( "context" diff --git a/go/performance/utils/sysbench_runner/sysbench_config.go b/go/performance/utils/benchmark_runner/sysbench_config.go similarity index 96% rename from go/performance/utils/sysbench_runner/sysbench_config.go rename to go/performance/utils/benchmark_runner/sysbench_config.go index da5af42bfa..dee682c8a3 100644 --- a/go/performance/utils/sysbench_runner/sysbench_config.go +++ b/go/performance/utils/benchmark_runner/sysbench_config.go @@ -12,11 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -package sysbench_runner +package benchmark_runner import ( "context" - "encoding/json" "errors" "fmt" "io/fs" @@ -326,22 +325,6 @@ func GetTests(config SysbenchConfig, serverConfig ServerConfig) ([]Test, error) return flattened, nil } -// FromFileConfig returns a validated sysbenchRunnerConfigImpl based on the config file at the configPath -func FromFileConfig(configPath string) (SysbenchConfig, error) { - data, err := os.ReadFile(configPath) - if err != nil { - return nil, err - } - - config := NewRunnerConfig() - err = json.Unmarshal(data, config) - if err != nil { - return nil, err - } - - return config, nil -} - func getMustSupplyError(name string) error { return fmt.Errorf("Must supply %s", name) } diff --git a/go/performance/utils/sysbench_runner/sysbench_config_test.go b/go/performance/utils/benchmark_runner/sysbench_config_test.go similarity index 99% rename from go/performance/utils/sysbench_runner/sysbench_config_test.go rename to go/performance/utils/benchmark_runner/sysbench_config_test.go index a58c2946c5..47856c0e43 100644 --- a/go/performance/utils/sysbench_runner/sysbench_config_test.go +++ b/go/performance/utils/benchmark_runner/sysbench_config_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package sysbench_runner +package benchmark_runner import ( "testing" diff --git a/go/performance/utils/sysbench_runner/sysbench_tests.go b/go/performance/utils/benchmark_runner/sysbench_tests.go similarity index 75% rename from go/performance/utils/sysbench_runner/sysbench_tests.go rename to go/performance/utils/benchmark_runner/sysbench_tests.go index ab1b7c2f94..496bfea4ca 100644 --- a/go/performance/utils/sysbench_runner/sysbench_tests.go +++ b/go/performance/utils/benchmark_runner/sysbench_tests.go @@ -1,4 +1,18 @@ -package sysbench_runner +// Copyright 2019-2022 Dolthub, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package benchmark_runner type sysbenchTestParamsImpl struct { params []string diff --git a/go/performance/utils/sysbench_runner/test_config.go b/go/performance/utils/benchmark_runner/test_config.go similarity index 71% rename from go/performance/utils/sysbench_runner/test_config.go rename to go/performance/utils/benchmark_runner/test_config.go index 6e23e2acf8..95f3d4aef8 100644 --- a/go/performance/utils/sysbench_runner/test_config.go +++ b/go/performance/utils/benchmark_runner/test_config.go @@ -1,4 +1,18 @@ -package sysbench_runner +// Copyright 2019-2022 Dolthub, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package benchmark_runner import "github.com/google/uuid" diff --git a/go/performance/utils/sysbench_runner/tester.go b/go/performance/utils/benchmark_runner/tester.go similarity index 53% rename from go/performance/utils/sysbench_runner/tester.go rename to go/performance/utils/benchmark_runner/tester.go index faba21e193..7a2bed306c 100644 --- a/go/performance/utils/sysbench_runner/tester.go +++ b/go/performance/utils/benchmark_runner/tester.go @@ -1,4 +1,18 @@ -package sysbench_runner +// Copyright 2019-2022 Dolthub, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package benchmark_runner import "context" diff --git a/go/performance/utils/sysbench_runner/tpcc.go b/go/performance/utils/benchmark_runner/tpcc.go similarity index 80% rename from go/performance/utils/sysbench_runner/tpcc.go rename to go/performance/utils/benchmark_runner/tpcc.go index a4cc1c6579..e8dc59c33f 100644 --- a/go/performance/utils/sysbench_runner/tpcc.go +++ b/go/performance/utils/benchmark_runner/tpcc.go @@ -1,4 +1,18 @@ -package sysbench_runner +// Copyright 2019-2022 Dolthub, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package benchmark_runner import ( "context" diff --git a/go/performance/utils/sysbench_runner/tpcc_config.go b/go/performance/utils/benchmark_runner/tpcc_config.go similarity index 89% rename from go/performance/utils/sysbench_runner/tpcc_config.go rename to go/performance/utils/benchmark_runner/tpcc_config.go index c462cbb0d0..ab568b0177 100644 --- a/go/performance/utils/sysbench_runner/tpcc_config.go +++ b/go/performance/utils/benchmark_runner/tpcc_config.go @@ -12,13 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -package sysbench_runner +package benchmark_runner import ( "context" - "encoding/json" "fmt" - "os" "runtime" ) @@ -145,19 +143,3 @@ func (c *tpccConfigImpl) Validate(ctx context.Context) error { c.setDefaults() return c.validateServerConfigs() } - -// FromFileTpccConfig returns a validated TpccConfig based on the config file at the configPath -func FromFileTpccConfig(configPath string) (TpccConfig, error) { - data, err := os.ReadFile(configPath) - if err != nil { - return nil, err - } - - config := NewTpccRunnerConfig() - err = json.Unmarshal(data, config) - if err != nil { - return nil, err - } - - return config, nil -} diff --git a/go/performance/utils/sysbench_runner/tpcc_tests.go b/go/performance/utils/benchmark_runner/tpcc_tests.go similarity index 92% rename from go/performance/utils/sysbench_runner/tpcc_tests.go rename to go/performance/utils/benchmark_runner/tpcc_tests.go index 20af830152..a7df1f10eb 100644 --- a/go/performance/utils/sysbench_runner/tpcc_tests.go +++ b/go/performance/utils/benchmark_runner/tpcc_tests.go @@ -1,4 +1,18 @@ -package sysbench_runner +// Copyright 2019-2022 Dolthub, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package benchmark_runner import ( "fmt" diff --git a/go/performance/utils/sysbench_runner/benchmark.go b/go/performance/utils/sysbench_runner/benchmark.go deleted file mode 100644 index b7c272771a..0000000000 --- a/go/performance/utils/sysbench_runner/benchmark.go +++ /dev/null @@ -1,7 +0,0 @@ -package sysbench_runner - -import "context" - -type Benchmarker interface { - Benchmark(ctx context.Context) (Results, error) -} diff --git a/go/performance/utils/sysbench_runner/cmd/main.go b/go/performance/utils/sysbench_runner/cmd/main.go deleted file mode 100644 index 07143dc361..0000000000 --- a/go/performance/utils/sysbench_runner/cmd/main.go +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2019-2022 Dolthub, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package main - -import ( - "context" - "flag" - "log" - "os" - "path/filepath" - - runner "github.com/dolthub/dolt/go/performance/utils/sysbench_runner" -) - -var tpcc = flag.Bool("tpcc", false, "run tpcc benchmarks") -var configFile = flag.String("config", "", "path to config file") - -func main() { - flag.Parse() - - if *configFile == "" { - log.Fatal("Must supply config") - } - - configPath, err := filepath.Abs(*configFile) - if err != nil { - log.Fatal(err) - } - if _, err = os.Stat(configPath); os.IsNotExist(err) { - log.Fatal(err) - } - - ctx := context.Background() - if *tpcc { - err = runTpcc(ctx, configPath) - } else { - err = run(ctx, configPath) - } - if err != nil { - log.Fatal(err) - } -} - -func runTpcc(ctx context.Context, configPath string) error { - config, err := runner.FromFileTpccConfig(configPath) - if err != nil { - return err - } - return runner.RunTpcc(ctx, config) -} - -func run(ctx context.Context, configPath string) error { - config, err := runner.FromFileConfig(configPath) - if err != nil { - return err - } - return runner.Run(ctx, config) -} diff --git a/go/performance/utils/sysbench_runner/config.go b/go/performance/utils/sysbench_runner/config.go deleted file mode 100644 index 50ee8a1180..0000000000 --- a/go/performance/utils/sysbench_runner/config.go +++ /dev/null @@ -1,25 +0,0 @@ -package sysbench_runner - -import "context" - -type Config interface { - GetRuns() int - GetScriptDir() string - GetNomsBinFormat() string - GetRuntimeOs() string - GetRuntimeGoArch() string - GetServerConfigs() []ServerConfig - Validate(ctx context.Context) error - ContainsServerOfType(server ServerType) bool -} - -type SysbenchConfig interface { - Config - GetTestOptions() []string - GetTestConfigs() []TestConfig -} - -type TpccConfig interface { - Config - GetScaleFactors() []int -}