forked from cmu-db/benchbase
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New Benchmark: OtterTune Metrics (cmu-db#175)
- Loading branch information
Showing
18 changed files
with
939 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?xml version="1.0"?> | ||
<parameters> | ||
|
||
<!-- Connection details --> | ||
<type>COCKROACHDB</type> | ||
<driver>org.postgresql.Driver</driver> | ||
<url>jdbc:postgresql://localhost:26257/benchbase?sslmode=disable&ApplicationName=otmetrics&reWriteBatchedInserts=true</url> | ||
<username>admin</username> | ||
<password>password</password> | ||
<retries>4</retries> | ||
|
||
<batchsize>2048</batchsize> | ||
<scalefactor>0.1</scalefactor> | ||
|
||
<!-- The workload --> | ||
<terminals>1</terminals> | ||
<works> | ||
<work> | ||
<time>60</time> | ||
<rate>unlimited</rate> | ||
<weights>100</weights> | ||
</work> | ||
</works> | ||
|
||
<!-- Transaction Declaration --> | ||
<transactiontypes> | ||
<transactiontype> | ||
<name>GetSessionRange</name> | ||
</transactiontype> | ||
</transactiontypes> | ||
</parameters> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?xml version="1.0"?> | ||
<parameters> | ||
|
||
<!-- Connection details --> | ||
<type>MARIADB</type> | ||
<driver>org.mariadb.jdbc.Driver</driver> | ||
<url>jdbc:mariadb://localhost:3306/benchbase?useServerPrepStmts</url> | ||
<username>admin</username> | ||
<password>password</password> | ||
|
||
<batchsize>10000</batchsize> | ||
<scalefactor>0.1</scalefactor> | ||
|
||
<!-- The workload --> | ||
<terminals>1</terminals> | ||
<works> | ||
<work> | ||
<time>60</time> | ||
<rate>unlimited</rate> | ||
<weights>100</weights> | ||
</work> | ||
</works> | ||
|
||
<!-- Transaction Declaration --> | ||
<transactiontypes> | ||
<transactiontype> | ||
<name>GetSessionRange</name> | ||
</transactiontype> | ||
</transactiontypes> | ||
</parameters> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?xml version="1.0"?> | ||
<parameters> | ||
|
||
<!-- Connection details --> | ||
<type>MYSQL</type> | ||
<driver>com.mysql.cj.jdbc.Driver</driver> | ||
<url>jdbc:mysql://localhost:3306/benchbase?rewriteBatchedStatements=true&sslMode=DISABLED</url> | ||
<username>admin</username> | ||
<password>password</password> | ||
|
||
<batchsize>2048</batchsize> | ||
<scalefactor>0.1</scalefactor> | ||
|
||
<!-- The workload --> | ||
<terminals>1</terminals> | ||
<works> | ||
<work> | ||
<time>60</time> | ||
<rate>unlimited</rate> | ||
<weights>100</weights> | ||
</work> | ||
</works> | ||
|
||
<!-- Transaction Declaration --> | ||
<transactiontypes> | ||
<transactiontype> | ||
<name>GetSessionRange</name> | ||
</transactiontype> | ||
</transactiontypes> | ||
</parameters> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?xml version="1.0"?> | ||
<parameters> | ||
|
||
<!-- Connection details --> | ||
<type>POSTGRES</type> | ||
<driver>org.postgresql.Driver</driver> | ||
<url>jdbc:postgresql://localhost:5432/benchbase?sslmode=disable&ApplicationName=otmetrics&reWriteBatchedInserts=true</url> | ||
<username>admin</username> | ||
<password>password</password> | ||
|
||
<batchsize>2048</batchsize> | ||
<scalefactor>0.1</scalefactor> | ||
|
||
<!-- The workload --> | ||
<terminals>1</terminals> | ||
<works> | ||
<work> | ||
<time>60</time> | ||
<rate>unlimited</rate> | ||
<weights>100</weights> | ||
</work> | ||
</works> | ||
|
||
<!-- Transaction Declaration --> | ||
<transactiontypes> | ||
<transactiontype> | ||
<name>GetSessionRange</name> | ||
</transactiontype> | ||
</transactiontypes> | ||
</parameters> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?xml version="1.0"?> | ||
<parameters> | ||
|
||
<!-- Connection details --> | ||
<type>SQLITE</type> | ||
<driver>org.sqlite.JDBC</driver> | ||
<url>jdbc:sqlite:otmetrics.db</url> | ||
<isolation>TRANSACTION_SERIALIZABLE</isolation> | ||
<batchsize>10000</batchsize> | ||
<scalefactor>0.01</scalefactor> | ||
|
||
<!-- SQLITE only supports one writer thread --> | ||
<loaderThreads>1</loaderThreads> | ||
|
||
<!-- The workload --> | ||
<terminals>1</terminals> | ||
<works> | ||
<work> | ||
<time>60</time> | ||
<rate>unlimited</rate> | ||
<weights>100</weights> | ||
</work> | ||
</works> | ||
|
||
<!-- Transaction Declaration --> | ||
<transactiontypes> | ||
<transactiontype> | ||
<name>GetSessionRange</name> | ||
</transactiontype> | ||
</transactiontypes> | ||
</parameters> |
70 changes: 70 additions & 0 deletions
70
src/main/java/com/oltpbenchmark/benchmarks/otmetrics/OTMetricsBenchmark.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/* | ||
* Copyright 2022 by OLTPBenchmark Project | ||
* | ||
* 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 com.oltpbenchmark.benchmarks.otmetrics; | ||
|
||
import com.oltpbenchmark.WorkloadConfiguration; | ||
import com.oltpbenchmark.api.BenchmarkModule; | ||
import com.oltpbenchmark.api.Loader; | ||
import com.oltpbenchmark.api.Worker; | ||
import com.oltpbenchmark.benchmarks.otmetrics.procedures.GetSessionRange; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
/** | ||
* OtterTune Metrics Timeseries Benchmark | ||
* @author pavlo | ||
*/ | ||
public class OTMetricsBenchmark extends BenchmarkModule { | ||
|
||
private static final Logger LOG = LoggerFactory.getLogger(OTMetricsBenchmark.class); | ||
|
||
protected final int num_sources; | ||
protected final int num_sessions; | ||
protected final long num_observations; | ||
|
||
public OTMetricsBenchmark(WorkloadConfiguration workConf) { | ||
super(workConf); | ||
|
||
// Compute the number of records per table. | ||
this.num_sources = (int) Math.round(OTMetricsConstants.NUM_SOURCES * workConf.getScaleFactor()); | ||
this.num_sessions = (int) Math.round(OTMetricsConstants.NUM_SESSIONS * workConf.getScaleFactor()); | ||
this.num_observations = (long) Math.round(OTMetricsConstants.NUM_OBSERVATIONS * workConf.getScaleFactor()); | ||
} | ||
|
||
@Override | ||
protected Package getProcedurePackageImpl() { | ||
return GetSessionRange.class.getPackage(); | ||
} | ||
|
||
@Override | ||
protected List<Worker<? extends BenchmarkModule>> makeWorkersImpl() { | ||
List<Worker<? extends BenchmarkModule>> workers = new ArrayList<>(); | ||
for (int i = 0; i < workConf.getTerminals(); ++i) { | ||
workers.add(new OTMetricsWorker(this, i)); | ||
} | ||
return workers; | ||
} | ||
|
||
@Override | ||
protected Loader<OTMetricsBenchmark> makeLoaderImpl() { | ||
return new OTMetricsLoader(this); | ||
} | ||
|
||
} |
47 changes: 47 additions & 0 deletions
47
src/main/java/com/oltpbenchmark/benchmarks/otmetrics/OTMetricsConstants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* Copyright 2020 by OLTPBenchmark Project | ||
* | ||
* 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 com.oltpbenchmark.benchmarks.otmetrics; | ||
|
||
import java.time.LocalDateTime; | ||
import java.time.Month; | ||
|
||
public abstract class OTMetricsConstants { | ||
|
||
/** | ||
* Table Names | ||
*/ | ||
public static final String TABLENAME_SOURCES = "sources"; | ||
public static final String TABLENAME_SESSIONS = "sessions"; | ||
public static final String TABLENAME_TYPES = "types"; | ||
public static final String TABLENAME_OBSERVATIONS = "observations"; | ||
|
||
/** | ||
* Number of records per table. | ||
* All of the tables in this benchmark will scale as you change the benchmark scalefactor | ||
*/ | ||
public static final int NUM_SOURCES = 100; | ||
public static final int NUM_SESSIONS = 1000; | ||
public static final int NUM_TYPES = 500; // FIXED SIZE | ||
public static final int NUM_OBSERVATIONS = 10000; | ||
|
||
/** | ||
* All objects in the database will be created starting after this date | ||
*/ | ||
public static final LocalDateTime START_DATE = LocalDateTime.of(2022, Month.JANUARY, 1, 0, 0); | ||
|
||
} |
Oops, something went wrong.