Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
N
NFRTool - Time and Energy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
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
ELASTIC-H2020
ELASTIC-SA
NFR-Tool
NFRTool - Time and Energy
Commits
80e4323f
Commit
80e4323f
authored
Feb 01, 2021
by
Rita Sousa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added some tests for the integration with nfrtool-comms
parent
8923a65b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
74 additions
and
3 deletions
+74
-3
app/src/main/java/app/NFRTool.java
app/src/main/java/app/NFRTool.java
+74
-3
No files found.
app/src/main/java/app/NFRTool.java
View file @
80e4323f
...
...
@@ -117,11 +117,29 @@ public class NFRTool {
ElasticSystem
system
=
new
ElasticSystem
();
// App A definition:
String
name
=
"AppA"
;
String
uuid
=
"A"
;
final
int
monitoringPeriod
=
1
;
String
infoNature
=
"delaySensitive"
;
COMPSsApplication
appA
=
new
COMPSsApplication
(
name
,
uuid
,
monitoringPeriod
);
appA
.
setInfoNature
(
infoNature
);
// App B definition:
name
=
"AppB"
;
uuid
=
"B"
;
infoNature
=
"TCPservices"
;
COMPSsApplication
appB
=
new
COMPSsApplication
(
name
,
uuid
,
monitoringPeriod
);
appB
.
setInfoNature
(
infoNature
);
// Create application
int
monitoringPeriod
=
5000
;
/*
int monitoringPeriod = 5000;
COMPSsApplication app = new COMPSsApplication(applicationName, "1.0", monitoringPeriod);
system.addApplication(app);
*/
// Create node1 and persist it
String
nodeName
=
"xavier-rit"
;
float
signalWifi
=
(
float
)
0.0
;
...
...
@@ -130,6 +148,59 @@ public class NFRTool {
node1
.
makePersistent
(
nodeName
);
system
.
addNode
(
node1
);
//
// Node 2 definition:
nodeName
=
"xavier-ric"
;
ipWifi
=
"182.168.137.179"
;
ipLte
=
"172.10.0.4"
;
ipEth
=
"192.168.60.65"
;
// TODO: check value
cpuThreshold
=
0
;
energyThreshold
=
0
;
signalWifi
=
-
30
;
numCores
=
8
;
Node
node2
=
new
Node
(
ipWifi
,
ipEth
,
ipLte
,
cpuThreshold
,
energyThreshold
,
signalWifi
,
numCores
);
node2
.
makePersistent
(
nodeName
);
// Worker 1A definition:
final
int
pid1A
=
32145
;
final
boolean
active1A
=
true
;
final
float
cpuUsage1A
=
0
;
final
float
energyUsage1A
=
0
;
final
int
computingUnits1A
=
4
;
final
float
communicationCost1A
=
0
;
// Worker 2A definition:
final
int
pid2A
=
32147
;
final
boolean
active2A
=
true
;
final
float
cpuUsage2A
=
0
;
final
float
energyUsage2A
=
0
;
final
int
computingUnits2A
=
4
;
final
float
communicationCost2A
=
0
;
Worker
worker2A
=
new
Worker
(
node2
,
pid2A
,
active2A
,
appA
,
cpuUsage2A
,
energyUsage2A
,
computingUnits2A
,
node2
.
getIpEth
(),
communicationCost2A
,
new
ArrayList
<>());
// Attach worker to Node and COMPSsApplication
//node2.addWorker(worker2A);
appA
.
addWorker
(
worker2A
);
// Worker 2B definition:
final
int
pid2B
=
32148
;
final
boolean
active2B
=
true
;
final
float
cpuUsage2B
=
0
;
final
float
energyUsage2B
=
0
;
final
int
computingUnits2B
=
4
;
final
float
communicationCost2B
=
0
;
Worker
worker2B
=
new
Worker
(
node2
,
pid2B
,
active2B
,
appB
,
cpuUsage2B
,
energyUsage2B
,
computingUnits2B
,
node2
.
getIpEth
(),
communicationCost2B
,
new
ArrayList
<>());
// Attach worker to Node and COMPSsApplication
//node2.addWorker(worker2B);
appB
.
addWorker
(
worker2B
);
// Get node by alias
Node
node
=
Node
.
getByAlias
(
nodeName
);
...
...
@@ -141,7 +212,7 @@ public class NFRTool {
// Set master of application
app
.
setMaster
(
master
);
addWorkersToSystem
(
node
,
app
,
localIP
);
addWorkersToSystem
(
node
,
app
A
,
localIP
);
// TODO: After finalizing the system, insert the Workers creation here including
// adding them to the application
...
...
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