Package org.cloudsimplus.traces.google
Class MachineEvent
java.lang.Object
org.cloudsimplus.traces.google.MachineEvent
public final class MachineEvent
extends java.lang.Object
A data class to store the attributes to create a
Host
,
according to the data read from a line inside a "machine events" trace file.
Instance of this class are created by the GoogleMachineEventsTraceReader
and provided to the user's simulation.
In order to create such Hosts, the GoogleMachineEventsTraceReader
requires
the developer to provide a Function
that creates Hosts according to the developer needs.
The GoogleMachineEventsTraceReader
cannot create the Hosts itself
by hardcoding some simulation specific parameters such as the VmScheduler
or ResourceProvisioner
. This way, it request a Function
implemented
by the developer using the GoogleMachineEventsTraceReader
class
that has the custom logic to create Hosts.
However, this developer's Function
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
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)
-
Constructor Details
-
MachineEvent
public MachineEvent()
-
-
Method Details
-
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
-
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:
-