-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMicroserviceScaleEvent.java
More file actions
32 lines (26 loc) · 983 Bytes
/
MicroserviceScaleEvent.java
File metadata and controls
32 lines (26 loc) · 983 Bytes
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
32
package cambio.simulator.entities.microservice;
import cambio.simulator.entities.NamedExternalEvent;
import cambio.simulator.models.MiSimModel;
import co.paralleluniverse.fibers.SuspendExecution;
/**
* For now this is an unused event to represent the scaling of a microservice.
*
* @author Lion Wagner
*/
public class MicroserviceScaleEvent extends NamedExternalEvent {
private final Microservice microservice;
private final int targetInstanceCount;
/**
* Creates a new scaling event.
*/
public MicroserviceScaleEvent(MiSimModel model, String name, boolean showInTrace, Microservice microservice,
int targetInstanceCount) {
super(model, name, showInTrace);
this.microservice = microservice;
this.targetInstanceCount = targetInstanceCount;
}
@Override
public void eventRoutine() throws SuspendExecution {
microservice.scaleToInstancesCount(targetInstanceCount);
}
}