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

[no-release-notes] Stats on for TPC-C #7489

Merged
merged 5 commits into from
Feb 14, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ meanMultiplierWritesQuery="select round(avg(multipliers), $precision) as writes_

meanMultiplierOverallQuery="select round(avg(multipliers), $precision) as overall_mean_multiplier from (select (round(avg(t.latency_percentile) / (avg(f.latency_percentile) + .000001), $precision)) as multipliers from from_results as f join to_results as t on f.test_name = t.test_name where f.test_name != 'bulk_insert' group by f.test_name)"

tpccLatencyQuery="select f.test_name as test_name, f.server_name, f.server_version, avg(f.latency_percentile) as from_latency_median, t.server_name, t.server_version, avg(t.latency_percentile) as to_latency_median, ROUND(avg(t.latency_percentile) / (avg(f.latency_percentile) + .000001), $precision) as multiplier from from_results as f join to_results as t on f.test_name = t.test_name where f.test_name LIKE '$tpccRegex' group by f.test_name;"
tpccTpsQuery="select f.test_name as test_name, f.server_name, f.server_version, avg(f.sql_transactions_per_second) as tps, t.test_name as test_name, t.server_name, t.server_version, avg(t.sql_transactions_per_second) as tps from from_results as f join to_results as t on f.test_name = t.test_name where f.test_name LIKE 'tpcc%' group by f.test_name;"
tpccLatencyQuery="select f.test_name as tpcc_latency, f.server_name, f.server_version, avg(f.latency_percentile) as from_latency_median, t.server_name, t.server_version, avg(t.latency_percentile) as to_latency_median, ROUND(avg(t.latency_percentile) / (avg(f.latency_percentile) + .000001), $precision) as multiplier from from_results as f join to_results as t on f.test_name = t.test_name where f.test_name LIKE '$tpccRegex' group by f.test_name;"
tpccTpsQuery="select f.test_name as tpcc_tps, f.server_name, f.server_version, avg(f.sql_transactions_per_second) as from_tps, t.test_name as test_name, t.server_name, t.server_version, avg(t.sql_transactions_per_second) as to_tps, ROUND(avg(t.latency_percentile) / (avg(f.latency_percentile) + .000001), $precision) as multiplier from from_results as f join to_results as t on f.test_name = t.test_name where f.test_name LIKE 'tpcc%' group by f.test_name;"
tpccTpsMultiplierQuery="select round(avg(t.latency_percentile) / (avg(f.latency_percentile) + .000001), $precision) as tpcc_tps_multiplier from from_results as f join to_results as t on f.test_name = t.test_name where f.test_name like 'tpcc%' group by f.test_name"

echo '
{
Expand Down Expand Up @@ -109,6 +110,7 @@ echo '
"--sysbenchQueries='"$meanMultiplierOverallQuery"'",
"--tpccQueries='"$tpccLatencyQuery"'",
"--tpccQueries='"$tpccTpsQuery"'"
"--tpccQueries='"$tpccTpsMultiplierQuery"'"
]
}
],
Expand Down
20 changes: 20 additions & 0 deletions go/performance/utils/benchmark_runner/dolt_tpcc.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ func (b *doltTpccBenchmarkerImpl) Benchmark(ctx context.Context) (Results, error
}
defer os.RemoveAll(testRepo)

if err := configureServer(ctx, b.serverConfig.GetServerExec(), testRepo); err != nil {
return nil, err
}

serverParams, err := b.serverConfig.GetServerArgs()
if err != nil {
return nil, err
Expand Down Expand Up @@ -114,3 +118,19 @@ func GetTpccTests(config TpccConfig) []Test {
}
return tests
}

func configureServer(ctx context.Context, doltPath, dbPath string) error {
queries := []string{
"set @@PERSIST.dolt_stats_auto_refresh_enabled = 1;",
"set @@PERSIST.dolt_stats_auto_refresh_interval = 2;",
"set @@PERSIST.dolt_stats_auto_refresh_threshold = 1.0;",
}
for _, q := range queries {
q := ExecCommand(ctx, doltPath, "sql", "-q", q)
q.Dir = dbPath
if err := q.Run(); err != nil {
return err
}
}
return nil
}
2 changes: 1 addition & 1 deletion go/performance/utils/benchmark_runner/tpcc_tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ var _ TestParams = &tpccTestParamsImpl{}
// NewDefaultTpccParams returns default TpccTestParams.
func NewDefaultTpccParams() *tpccTestParamsImpl {
return &tpccTestParamsImpl{
NumThreads: 2, // TODO: When ready, expose as command line argument.
NumThreads: 1, // TODO: When ready, expose as command line argument.
ScaleFactor: 1,
Tables: 1,
TrxLevel: tpccTransactionLevelRr,
Expand Down
Loading