blob: fc1d666f6c0ec6ce1b83cda5ac5318389d4bcf88 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
package hu.bme.mit.inf.dslreasoner.domains.cps.mdeo
import hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance
class ResourceUtilizationUtil {
private new() {
new IllegalStateException("This is a static utility class and should not be instantiated directly.")
}
static def getMemoryUtilization(HostInstance host) {
var int utilization = 0
for (app : host.applications) {
val req = app.type.requirements.findFirst[hostType == host.type]
if (req !== null) {
utilization += req.requiredMemory
}
}
utilization
}
static def getHddUtilization(HostInstance host) {
var int utilization = 0
for (app : host.applications) {
val req = app.type.requirements.findFirst[hostType == host.type]
if (req !== null) {
utilization += req.requiredHdd
}
}
utilization
}
}
|