Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option for sysbench perf tests to clone big repo #3326

Merged
merged 5 commits into from Apr 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -73,7 +73,8 @@ echo '
"--sysbenchQueries='"$medianLatencyChangeReadsQuery"'",
"--sysbenchQueries='"$medianLatencyChangeWritesQuery"'",
"--tpccQueries='"$tpccLatencyQuery"'",
"--tpccQueries='"$tpccTpsQuery"'"
"--tpccQueries='"$tpccTpsQuery"'",
"--init-big-repo"
]
}
],
Expand Down
3 changes: 2 additions & 1 deletion go/performance/continuous_integration/config.json
Expand Up @@ -18,5 +18,6 @@
}
],
"ScriptDir":"/sysbench-lua-scripts",
"TestOptions": ["--rand-seed=1", "--table-size=30"]
"TestOptions": ["--rand-seed=1", "--table-size=30"],
"InitBigRepo": true
}
8 changes: 2 additions & 6 deletions go/performance/utils/sysbench_runner/config.go
Expand Up @@ -266,25 +266,21 @@ func (sc *ServerConfig) GetServerArgs() []string {
type Config struct {
// Runs is the number of times to run all tests
Runs int

// RuntimeOS is the platform the benchmarks ran on
RuntimeOS string

// RuntimeGoArch is the runtime architecture
RuntimeGoArch string

// Servers are the servers to benchmark
Servers []*ServerConfig

// Tests are the tests to run. If no tests are provided,
// the default tests will be used
Tests []*ConfigTest

// TestOptions a list of sysbench test options to apply to all tests
TestOptions []string

// ScriptDir is a path to a directory of lua scripts
ScriptDir string
// DirtyClone downloads a database with existing chunks and commits
InitBigRepo bool
}

// NewConfig returns a new Config
Expand Down
16 changes: 12 additions & 4 deletions go/performance/utils/sysbench_runner/dolt.go
Expand Up @@ -29,8 +29,9 @@ import (
)

const (
dbName = "test"
luaPath = "?.lua"
dbName = "test"
luaPath = "?.lua"
bigEmptyRepo = "max-hoffman/big-empty"
)

var stampFunc = func() string { return time.Now().UTC().Format(stampFormat) }
Expand All @@ -49,7 +50,7 @@ func BenchmarkDolt(ctx context.Context, config *Config, serverConfig *ServerConf
return nil, err
}

testRepo, err := initDoltRepo(ctx, serverConfig)
testRepo, err := initDoltRepo(ctx, serverConfig, config.InitBigRepo)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -132,13 +133,20 @@ func doltVersion(ctx context.Context, config *ServerConfig) error {
}

// initDoltRepo initializes a dolt repo and returns the repo path
func initDoltRepo(ctx context.Context, config *ServerConfig) (string, error) {
func initDoltRepo(ctx context.Context, config *ServerConfig, initBigRepo bool) (string, error) {
cwd, err := os.Getwd()
if err != nil {
return "", err
}

testRepo := filepath.Join(cwd, dbName)
if initBigRepo {
err := ExecCommand(ctx, config.ServerExec, "clone", bigEmptyRepo, dbName).Run()
if err != nil {
return "", err
}
return testRepo, nil
}
err = os.MkdirAll(testRepo, os.ModePerm)
if err != nil {
return "", err
Expand Down
1 change: 1 addition & 0 deletions go/performance/utils/sysbench_runner/run_test.go
Expand Up @@ -53,6 +53,7 @@ func TestRunner(t *testing.T) {
"--time=120",
"--percentile=50",
},
InitBigRepo: true,
}

err = Run(conf)
Expand Down