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
c79548b8
Commit
c79548b8
authored
Sep 30, 2019
by
Julia Abramenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- added command generation for loading
- added command generation for executing Queries
parent
527b97b0
Pipeline
#59049
failed with stage
in 16 minutes and 38 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
22 deletions
+48
-22
src/main/java/de/uulm/omi/dbms/workload/api/impl/WorkloadApiServiceImpl.java
...lm/omi/dbms/workload/api/impl/WorkloadApiServiceImpl.java
+12
-5
src/main/java/de/uulm/omi/workload/tsbs/TSBSCommandBuilder.java
...in/java/de/uulm/omi/workload/tsbs/TSBSCommandBuilder.java
+36
-17
No files found.
src/main/java/de/uulm/omi/dbms/workload/api/impl/WorkloadApiServiceImpl.java
View file @
c79548b8
...
...
@@ -180,7 +180,10 @@ public class WorkloadApiServiceImpl extends WorkloadApiService {
while
(
processData
.
isAlive
())
{
Thread
.
sleep
(
1000
);
}
System
.
out
.
println
(
"finished data generating"
);
System
.
out
.
println
(
"finished data generation"
);
String
fileToLoad
=
TSBS_RESULT_FOLDER
+
taskId
+
"-"
+
workload
.
getTsbsDataConfig
().
getFormat
()
+
"-data.gz"
;
String
queriesToExecute
=
TSBS_RESULT_FOLDER
+
taskId
+
"-"
+
workload
.
getTsbsDataConfig
().
getFormat
()
+
"-"
+
workload
.
getTsbsQueryConfig
().
getQueryType
()
+
".gz"
;
//Generate Queries
String
generateQueriesCommand
=
""
;
...
...
@@ -199,17 +202,21 @@ public class WorkloadApiServiceImpl extends WorkloadApiService {
// Benchmarking insert/write performance
String
loadCommand
=
""
;
loadCommand
=
TSBSCommandBuilder
.
loadCommand
(
workload
.
getTsbsDataConfig
(),
workload
.
getTsbsLoadConfig
(),
TSBS_BINARY
);
ProcessBuilder
loadProcess
=
new
ProcessBuilder
();
loadProcess
.
command
(
UNIX_SHELL
,
UNIX_COMMAND_PARAM
,
loadCommand
);
loadCommand
=
TSBSCommandBuilder
.
loadCommand
(
workload
.
getTsbsDataConfig
(),
workload
.
getTsbsLoadConfig
(),
fileToLoad
);
loadCommand
+=
" > "
+
TSBS_RESULT_FOLDER
+
taskId
+
"_load_metrics.csv"
;
ProcessBuilder
loadProcess
=
new
ProcessBuilder
();
loadProcess
.
command
(
UNIX_SHELL
,
UNIX_COMMAND_PARAM
,
loadCommand
);
Process
processLoad
=
loadProcess
.
start
();
while
(
processLoad
.
isAlive
())
{
Thread
.
sleep
(
1000
);
}
System
.
out
.
println
(
"finished loading"
);
// Execute Queries
String
exeQueries
=
"cat "
+
queriesToExecute
+
" | gunzip > | "
;
exeQueries
+=
TSBSCommandBuilder
.
executeQueries
(
workload
.
getTsbsDataConfig
(),
workload
.
getTsbsQueryExecution
(),
queriesToExecute
);
workloadProcess
.
startWorkload
(
TSBS_BINARY
,
UNIX_SHELL
,
UNIX_COMMAND_PARAM
,
"ping www.google.com"
,
taskId
,
.
startWorkload
(
TSBS_BINARY
,
UNIX_SHELL
,
UNIX_COMMAND_PARAM
,
exeQueries
,
taskId
,
workloadTimestamp
);
WorkloadProcessInstance
workloadProcessInstance
=
new
WorkloadProcessInstance
();
workloadProcessInstance
.
setTimestamp
(
BigDecimal
.
valueOf
(
workloadProcess
.
getStartTimestamp
()));
...
...
src/main/java/de/uulm/omi/workload/tsbs/TSBSCommandBuilder.java
View file @
c79548b8
...
...
@@ -114,27 +114,24 @@ public class TSBSCommandBuilder {
else
return
generateQueryCommand
;
}
public
static
String
loadCommand
(
TSBSDataConfig
dataConfig
,
TSBSLoadConfig
loadConfig
,
String
tsbsBinary
)
{
public
static
String
loadCommand
(
TSBSDataConfig
dataConfig
,
TSBSLoadConfig
loadConfig
,
String
fileToLoad
)
{
checkNotNull
(
dataConfig
);
checkNotNull
(
loadConfig
);
boolean
fail
=
false
;
String
loadingCommand
=
""
;
//NUM_WORKERS=2 BATCH_SIZE=30 BULK_DATA_DIR=/tmp scripts/load_influx.sh > /tmp/load_metrics.csv
if
(
loadConfig
.
getNumberOfWorkers
().
intValue
()
>
0
)
{
loadingCommand
+=
"NUM_WORKERS="
+
loadConfig
.
getNumberOfWorkers
().
toString
()
+
" "
;
}
else
fail
=
true
;
if
(
loadConfig
.
getBatchSize
().
intValue
()
>
0
)
{
loadingCommand
+=
"BATCH_SIZE="
+
loadConfig
.
getBatchSize
().
toString
()
+
" "
;
String
loadingCommand
=
"tsbs_load_"
;
loadingCommand
+=
dataConfig
.
getFormat
().
toString
().
toLowerCase
()
+
" "
;
if
(
loadConfig
.
getBatchSize
().
intValue
()
>
0
)
{
loadingCommand
+=
"-batch-size="
+
loadConfig
.
getBatchSize
().
toString
()
+
" "
;
}
else
fail
=
true
;
if
(
loadConfig
.
getNumberOfWorkers
().
intValue
()
>
0
)
{
loadingCommand
+=
"-workers="
+
loadConfig
.
getNumberOfWorkers
().
toString
()
+
" "
;
}
else
fail
=
true
;
loadingCommand
+=
"BULK_DATA_DIR="
+
tsbsBinary
+
"/load_"
+
dataConfig
.
getFormat
().
toString
().
toLowerCase
()
+
".sh > /tmp/load_metrics.csv "
;
if
(
loadConfig
.
getDbmsPorperties
().
size
()
>
0
)
{
for
(
TSDBMSDBMSProperties
key
:
loadConfig
.
getDbmsPorperties
())
{
loadingCommand
+=
""
+
key
.
getName
().
toLowerCase
()
+
" "
+
"\""
+
key
.
getValue
().
toLowerCase
()
+
"\" "
;
if
(
loadConfig
.
getDbmsPorperties
().
size
()
>
0
)
{
for
(
TSDBMSDBMSProperties
prop
:
loadConfig
.
getDbmsPorperties
())
{
loadingCommand
+=
prop
.
getName
()
+
"="
+
"\""
+
prop
.
getValue
()
+
"\" "
;
}
}
else
fail
=
true
;
}
else
fail
=
true
;
loadingCommand
+=
"-file="
+
"\""
+
fileToLoad
+
"\""
;
System
.
out
.
println
(
loadingCommand
);
if
(
fail
)
{
LOGGER
.
error
(
"Loading command cannot be executed."
);
return
""
;
...
...
@@ -143,4 +140,26 @@ public class TSBSCommandBuilder {
}
public
static
String
executeQueries
(
TSBSDataConfig
dataConfig
,
TSBSQueryExecution
quExe
,
String
queriesToExecute
)
{
String
exeQueries
=
"tsbs_load_"
+
dataConfig
.
getFormat
()
+
" "
;
boolean
fail
=
false
;
if
(
quExe
.
getWorkers
().
intValue
()
>
0
)
{
exeQueries
+=
"-workers="
+
quExe
.
getWorkers
()
+
" "
;
}
else
fail
=
true
;
if
(
quExe
.
getDbmsPorperties
().
size
()
>
0
)
{
for
(
TSDBMSDBMSProperties
prop
:
quExe
.
getDbmsPorperties
())
{
exeQueries
+=
prop
.
getName
()
+
"=\""
+
prop
.
getValue
()
+
"\" "
;
}
}
else
fail
=
true
;
System
.
out
.
println
(
exeQueries
);
if
(
fail
)
{
LOGGER
.
error
(
"Query execution cannot be executed."
);
return
""
;
}
else
{
exeQueries
+=
"-file="
+
"\""
+
queriesToExecute
+
"\""
;
return
exeQueries
;
}
}
}
\ No newline at end of file
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