Package org.cloudsimplus.traces.google
Class MachineEvent
- java.lang.Object
-
- org.cloudsimplus.traces.google.MachineEvent
-
public final class MachineEvent extends Object
A data class to store the attributes to create aHost
, according to the data read from a line inside a "machine events" trace file. Instance of this class are created by theGoogleMachineEventsTraceReader
and provided to the user's simulation.In order to create such Hosts, the
GoogleMachineEventsTraceReader
requires the developer to provide aFunction
that creates Hosts according to the developer needs.The
GoogleMachineEventsTraceReader
cannot create the Hosts itself by hardcoding some simulation specific parameters such as theVmScheduler
orResourceProvisioner
. This way, it request aFunction
implemented by the developer using theGoogleMachineEventsTraceReader
class that has the custom logic to create Hosts. However, this developer'sFunction
needs to receive the host parameters read from the trace file. To avoid passing so many parameters to the developer's Function, an instance of this class that wraps all these parameters is used instead.- Since:
- CloudSim Plus 4.0.0
- Author:
- Manoel Campos da Silva Filho
-
-
Constructor Summary
Constructors Constructor Description MachineEvent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getCpuCores()
Gets the actual number ofPe
s (CPU cores) to be assigned to a Host, according theGoogleMachineEventsTraceReader.getMaxCpuCores()
.long
getMachineId()
Gets the machineID that indicates the machine onto which the task was scheduled.long
getRam()
Gets the actual RAM capacity to be assigned to a Host, according theGoogleMachineEventsTraceReader.getMaxRamCapacity()
.double
getTimestamp()
Gets the time the event happened (converted to seconds).protected MachineEvent
setRam(long ram)
-
-
-
Method Detail
-
getRam
public long getRam()
Gets the actual RAM capacity to be assigned to a Host, according theGoogleMachineEventsTraceReader.getMaxRamCapacity()
.- Returns:
- See Also:
GoogleMachineEventsTraceReader.FieldIndex.RAM_CAPACITY
-
setRam
protected MachineEvent setRam(long ram)
-
getCpuCores
public int getCpuCores()
Gets the actual number ofPe
s (CPU cores) to be assigned to a Host, according theGoogleMachineEventsTraceReader.getMaxCpuCores()
.- Returns:
- See Also:
GoogleMachineEventsTraceReader.FieldIndex.CPU_CAPACITY
-
getTimestamp
public double getTimestamp()
Gets the time the event happened (converted to seconds).- Returns:
- See Also:
GoogleMachineEventsTraceReader.FieldIndex.TIMESTAMP
-
getMachineId
public long getMachineId()
Gets the machineID that indicates the machine onto which the task was scheduled. If the field is empty, -1 is returned instead.- Returns:
-
-