Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
W
workload-API
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
3
Issues
3
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mowgli
workload-API
Commits
14c74c39
Commit
14c74c39
authored
Mar 03, 2020
by
Daniel Seybold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated TPC-C for cockroachdb to the lastest version
parent
e400e2c8
Pipeline
#74056
passed with stage
in 21 minutes and 41 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
73 additions
and
13 deletions
+73
-13
Dockerfile
Dockerfile
+6
-4
src/main/java/de/uulm/omi/dbms/workload/api/impl/WorkloadApiServiceImpl.java
...lm/omi/dbms/workload/api/impl/WorkloadApiServiceImpl.java
+57
-8
src/main/java/de/uulm/omi/workload/tpcc/TPCCCommandBuilder.java
...in/java/de/uulm/omi/workload/tpcc/TPCCCommandBuilder.java
+10
-1
No files found.
Dockerfile
View file @
14c74c39
...
...
@@ -52,10 +52,12 @@ ADD lib/ycsb_0.15/jdbc-binding/jdbc-binding-0.15.0.jar /opt/workloads/ycsb/jdbc-
###### CockroachDB loadgen for TPC-C ######
# downlaod cockroachdb loadgen
RUN
mkdir
/opt/workloads/cockroach-loadgen/
RUN
cd
/opt/workloads/cockroach-loadgen
RUN
wget https://edge-binaries.cockroachdb.com/cockroach/workload.LATEST
-O
loadgen.sh
RUN
chmod
+x loadgen.sh
RUN
mkdir
/opt/workloads/cockroach/
RUN
cd
/opt/workloads/cockroach
RUN
wget https://binaries.cockroachdb.com/cockroach-v19.2.4.linux-amd64.tgz
RUN
tar
fxvz cockroach-v19.2.4.linux-amd64.tgz
RUN
mv
cockroach-v19.2.4.linux-amd64 binary
RUN
rm
cockroach-v19.2.4.linux-amd64.tgz
###### TSBS by Timescale ######
...
...
src/main/java/de/uulm/omi/dbms/workload/api/impl/WorkloadApiServiceImpl.java
View file @
14c74c39
...
...
@@ -41,7 +41,7 @@ public class WorkloadApiServiceImpl extends WorkloadApiService {
//TPC-C constants
private
final
String
TPCC_RESULT_FOLDER
=
"TPCC/"
;
private
static
final
String
TPCC_BINARY
=
"./
loadgen.s
h"
;
private
static
final
String
TPCC_BINARY
=
"./
cockroac
h"
;
//TSBS constants
private
final
String
TSBS_RESULT_FOLDER
=
"/tmp/"
;
// TODO CHANGE
...
...
@@ -111,22 +111,71 @@ public class WorkloadApiServiceImpl extends WorkloadApiService {
Properties
properties
=
WorkloadApiProperties
.
getInstance
().
getProperties
();
String
binariyDirectory
=
properties
.
getProperty
(
WorkloadApiProperties
.
WORKLOAD_BINARIES_FOLDER
)
+
"cockroach/binary"
;
String
resultFileName
=
properties
.
getProperty
(
WorkloadApiProperties
.
WORKLOAD_RESULTS_FOLDER
)
+
TPCC_RESULT_FOLDER
+
taskId
+
".txt"
;
//Init the workload
Long
workloadTimestamp
=
System
.
currentTimeMillis
();
LOGGER
.
debug
(
"Creating TPC-C init command..."
);
String
initCommand
=
TPCCCommandBuilder
.
buildInitCommand
(
workload
.
getDbEndpoints
(),
TPCC_BINARY
);
initCommand
+=
" &> "
+
resultFileName
;
workloadProcess
.
startWorkload
(
binariyDirectory
,
UNIX_SHELL
,
UNIX_COMMAND_PARAM
,
initCommand
,
taskId
,
workloadTimestamp
);
WorkloadProcessInstance
workloadProcessInstance
=
new
WorkloadProcessInstance
();
workloadProcessInstance
.
setTimestamp
(
BigDecimal
.
valueOf
(
workloadProcess
.
getStartTimestamp
()));
workloadProcessInstance
.
setProcessId
(
workloadProcess
.
getProcessId
());
if
(
workloadProcess
.
isRunning
())
{
LOGGER
.
debug
(
"WorkloadPrcess started!"
);
workloadProcessInstance
.
setProcessStatus
(
ProcessStatus
.
RUNNING
);
}
else
{
if
(
workloadProcess
.
getExitCode
()
!=
0
)
{
LOGGER
.
debug
(
"workloadPrcess exited with "
+
workloadProcess
.
getExitCode
()
+
" Incorrect command provided? Command: "
+
initCommand
);
workloadProcessInstance
.
setProcessStatus
(
ProcessStatus
.
ERROR
);
return
Response
.
ok
().
entity
(
workloadProcessInstance
).
build
();
}
else
{
LOGGER
.
debug
(
"workloadPrcess already finished, incorrect command provided? Command: "
+
initCommand
);
workloadProcessInstance
.
setProcessStatus
(
ProcessStatus
.
IDLE
);
return
Response
.
ok
().
entity
(
workloadProcessInstance
).
build
();
}
}
// wait until init process is finished
while
(
workloadProcess
.
isRunning
()){
try
{
LOGGER
.
debug
(
"Waiting for TPC-C init to be finished, checking again in 5s..."
);
Thread
.
sleep
(
5000
);
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
}
LOGGER
.
debug
(
"TPC-C init finished, now starting the TPC-C execution!"
);
//Run the workload
workloadTimestamp
=
System
.
currentTimeMillis
();
String
startCommand
=
""
;
startCommand
=
TPCCCommandBuilder
.
buildStartCommand
(
workload
.
getTpccWorkloadConfig
(),
workload
.
getDbEndpoints
(),
TPCC_BINARY
);
startCommand
+=
" &>> "
+
resultFileName
;
String
resultFileName
=
properties
.
getProperty
(
WorkloadApiProperties
.
WORKLOAD_RESULTS_FOLDER
)
+
TPCC_RESULT_FOLDER
+
taskId
+
".txt"
;
startCommand
+=
" &> "
+
resultFileName
;
String
binariyDirectory
=
properties
.
getProperty
(
WorkloadApiProperties
.
WORKLOAD_BINARIES_FOLDER
)
+
"cockroach-loadgen"
;
workloadProcess
.
startWorkload
(
binariyDirectory
,
UNIX_SHELL
,
UNIX_COMMAND_PARAM
,
startCommand
,
taskId
,
workloadTimestamp
);
WorkloadProcessInstance
workloadProcessInstance
=
new
WorkloadProcessInstance
();
workloadProcessInstance
=
new
WorkloadProcessInstance
();
workloadProcessInstance
.
setTimestamp
(
BigDecimal
.
valueOf
(
workloadProcess
.
getStartTimestamp
()));
workloadProcessInstance
.
setProcessId
(
workloadProcess
.
getProcessId
());
if
(
workloadProcess
.
isRunning
())
{
...
...
src/main/java/de/uulm/omi/workload/tpcc/TPCCCommandBuilder.java
View file @
14c74c39
...
...
@@ -23,7 +23,7 @@ public class TPCCCommandBuilder {
checkNotNull
(
dbEndpoints
);
checkNotNull
(
tpccBinary
);
String
startCommand
=
tpccBinary
+
" run tpcc "
;
String
startCommand
=
tpccBinary
+
"
workload
run tpcc "
;
startCommand
+=
buildWorklaodCommand
(
workload
);
...
...
@@ -32,6 +32,15 @@ public class TPCCCommandBuilder {
return
startCommand
;
}
public
static
String
buildInitCommand
(
DBEndpoints
dbEndpoints
,
String
tpccBinary
){
String
initCommand
=
tpccBinary
+
" workload init tpcc "
;
initCommand
+=
buildConnectionUrl
(
dbEndpoints
);
return
initCommand
;
}
private
static
String
buildWorklaodCommand
(
TPCCWorkloadConfig
workload
){
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment