abstract
Service
requirements
:
Requirements
// resources required by a service
machine
->
Machine
// machine the service is allocated to
[
this
in
machine
.
services
]
// inverse relationship constraint
abstract
Requirements
cpu
->
integer
abstract
Resources
:
Requirements
abstract
Machine
services
->
Service
*
[
this
.
machine
= Machine
]
isFree
?
[
isFree
<=>
no
services
]
limits
:
Resources
utilization
:
Resources
[
cpu
=
sum
services
.
requirements
.
cpu
]
[
cpu
<
limits
.
cpu
]
Task
total_free
->
integer
= #
Machine
.
isFree
<<
max
Task
.
total_free
>>
abstract
InterferenceData
memoryPressure
->>
integer
memorySensitivity
->>
integer
abstract
MachineISAP
:
Machine
interferenceSensitiveServices
->
ServiceISAP
*
[
all s
:
services
|
s
in
ServiceISAP
<=>
s
in
interferenceSensitiveServices
]
abstract
ServiceISAP
:
Service
interferenceData
:
InterferenceData
machineISAP
->
MachineISAP
[
this
=
machine
]
totalPressure
->
integer
=
sum
machineISAP
.
interferenceSensitiveServices
.
interferenceData
.
memoryPressure
memoryPressureToThisService
->
integer
=
totalPressure
-
interferenceData
.
memoryPressure
// typecasting the machine to MachineISAP
[
memoryPressureToThisService
<=
interferenceData
.
memorySensitivity
]
GoogleCA
:
MachineISAP
[
limits
.
cpu
= 10
]
GoogleNY
:
MachineISAP
[
limits
.
cpu
= 16
]
// constraint:
GoogleTX
:
MachineISAP
[
limits
.
cpu
= 14
]
MailService
:
ServiceISAP
[
requirements
.
cpu
= 4
]
[
interferenceData
.
memoryPressure
= 4
]
[
interferenceData
.
memorySensitivity
= 6
]
SearchService
:
ServiceISAP
[
requirements
.
cpu
= 3
]
[
interferenceData
.
memoryPressure
= 4
]
[
interferenceData
.
memorySensitivity
= 2
]
CalendarService
:
Service
[
requirements
.
cpu
= 1
]
DriveService
:
Service
[
requirements
.
cpu
= 2
]