Class CloudletExecution
java.lang.Object
org.cloudsimplus.cloudlets.CloudletExecution
Stores execution information about a
Cloudlet submitted to a
specific Datacenter for processing.
This class keeps track of the time for all activities in the
Datacenter for a specific Cloudlet.
It acts as a data holder for maintaining the amount of resource share allocated at different times. As the VM where the Cloudlet is running might migrate to another Datacenter, each CloudletExecution object represents the data about execution of the cloudlet when the Vm was in a given Datacenter.
- Since:
- CloudSim Toolkit 1.0
- Author:
- Manzur Murshed, Rajkumar Buyya
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final CloudletExecutionA property that implements the Null Object Design Pattern forCloudletExecutionobjects. -
Constructor Summary
ConstructorsConstructorDescriptionCloudletExecution(Cloudlet cloudlet) Instantiates a CloudletExecution object upon the arrival of a Cloudlet inside a Datacenter. -
Method Summary
Modifier and TypeMethodDescriptiondoubleaddVirtualRuntime(double timeToAdd) Adds a given time to the.invalid reference
virtual runtimebooleanvoidFinalizes all relevant information before exiting the Datacenter.longdoubleReturns the expected cloudlet finish time (in seconds) if no RAM or BW over-subscription occurs.longgetId()longlongGets the remaining cloudlet length (in MI) that hasn't been executed yet, considering theCloudlet.getLength().doubleGets the remaining lifetime of the Cloudlet (in seconds) if a lifeTime is set.booleanhasCloudletFileTransferTimePassed(double currentTime) Checks if the time to transfer the files required by a Cloudlet has already passed to start executing the Cloudlet.inthashCode()booleanReturns true to indicate there is some BW or RAM oversubscription delay, false otherwise.booleanChecks if Cloudlet's RAM or BW has been oversubscribed, causing processing delay.booleanlastOverSubscriptionDelayNotPassed(double currentTime) Checks if the last BW or RAM oversubscription delay has passed, so that the cloudlet can start processing again.doubleprocessingTimeSpan(double currentTime) Computes the actual processing time span between the current simulation time and the last time the processing of a cloudlet was updated, subtracting the oversubscription wait time.doubleremainingOverSubscriptionDelay(double currentTime) Returns the time remaining to finish the last oversubscription delay.voidsetLastAllocatedMips(double lastAllocatedMips) Sets the last actually allocated MIPS for the Cloudlet.voidsetLastOverSubscriptionDelay(double overSubscriptionDelay) voidsetLastProcessingTime(double lastProcessingTime) Sets the last time this Cloudlet was processed at a Datacenter.booleansetStatus(Cloudlet.Status newStatus) Sets the Cloudlet status.toString()voidupdateProcessing(long partialFinishedMI) Updates the length of the Cloudlet that has executed so far.
-
Field Details
-
NULL
A property that implements the Null Object Design Pattern forCloudletExecutionobjects.
-
-
Constructor Details
-
CloudletExecution
Instantiates a CloudletExecution object upon the arrival of a Cloudlet inside a Datacenter. The arriving time is determined bySimulation.clock().- Parameters:
cloudlet- the Cloudlet to store execution information from
-
-
Method Details
-
getCloudletLength
public long getCloudletLength()- Returns:
- the
Cloudlet's length(in MI).
-
getPesNumber
public long getPesNumber() -
setStatus
Sets the Cloudlet status.- Parameters:
newStatus- the new Cloudlet status to set- Returns:
- true if the new status has been set, false if the status was the same as before
-
getRemainingCloudletLength
public long getRemainingCloudletLength()Gets the remaining cloudlet length (in MI) that hasn't been executed yet, considering theCloudlet.getLength().- Returns:
- remaining cloudlet length in MI
-
finalizeCloudlet
public void finalizeCloudlet()Finalizes all relevant information before exiting the Datacenter. This method sets the final data of:- wall clock time, i.e., the time of this Cloudlet resides in a Datacenter (from arrival to departure time);
- actual CPU time, i.e., the total execution time of this Cloudlet in a Datacenter;
- Cloudlet's finished time so far.
-
updateProcessing
public void updateProcessing(long partialFinishedMI) Updates the length of the Cloudlet that has executed so far.- Parameters:
partialFinishedMI- the partial amount of Million Instructions (MI) just executed, to be added to thepartialFinishedMI
-
getId
public long getId()- Returns:
- the ID of the executing Cloudlet.
-
setLastProcessingTime
public void setLastProcessingTime(double lastProcessingTime) Sets the last time this Cloudlet was processed at a Datacenter.- Parameters:
lastProcessingTime- the last processing time to set
-
processingTimeSpan
public double processingTimeSpan(double currentTime) Computes the actual processing time span between the current simulation time and the last time the processing of a cloudlet was updated, subtracting the oversubscription wait time.- Parameters:
currentTime- the current simulation time- Returns:
- the actual processing time span
-
hasCloudletFileTransferTimePassed
public boolean hasCloudletFileTransferTimePassed(double currentTime) Checks if the time to transfer the files required by a Cloudlet has already passed to start executing the Cloudlet.- Parameters:
currentTime- the current simulation time- Returns:
- true if the time to transfer the files has passed, false otherwise
-
addVirtualRuntime
public double addVirtualRuntime(double timeToAdd) Adds a given time to the.invalid reference
virtual runtime- Parameters:
timeToAdd- time to add to the virtual runtime (in seconds)- Returns:
- the new virtual runtime (in seconds)
-
toString
-
equals
-
hashCode
-
setLastAllocatedMips
public void setLastAllocatedMips(double lastAllocatedMips) Sets the last actually allocated MIPS for the Cloudlet. If no MIPS was allocated for a given time, the value is zero.This value is used to compute the expected finish time of a Cloudlet. If the allocated MIPS is zero, we don't have how to compute that.
- Parameters:
lastAllocatedMips- the value to set (if zero or negative, the attribute is not changed)
-
getExpectedFinishTime
public double getExpectedFinishTime()Returns the expected cloudlet finish time (in seconds) if no RAM or BW over-subscription occurs.- Returns:
- the expected cloudlet finish time (in seconds) if no RAM or BW over-subscription occurs
- See Also:
-
hasOverSubscription
public boolean hasOverSubscription()Checks if Cloudlet's RAM or BW has been oversubscribed, causing processing delay.- Returns:
- returns the over-subscription delay or 0 if there was no over-subscription up to now.
-
getRemainingLifeTime
public double getRemainingLifeTime()Gets the remaining lifetime of the Cloudlet (in seconds) if a lifeTime is set.- Returns:
- the remaining execution time if a lifeTime is set;
or
Double.MAX_VALUEotherwise to indicate no lifeTime was set, and it isn't known how much longer the Cloudlet will execute. - See Also:
-
lastOverSubscriptionDelayNotPassed
public boolean lastOverSubscriptionDelayNotPassed(double currentTime) Checks if the last BW or RAM oversubscription delay has passed, so that the cloudlet can start processing again.- Parameters:
currentTime- the current simulation time- Returns:
- true if the delay has passed, false otherwise
-
remainingOverSubscriptionDelay
public double remainingOverSubscriptionDelay(double currentTime) Returns the time remaining to finish the last oversubscription delay. After that, the Cloudlet will have the required resources (network and RAM data) to start processing again.- Parameters:
currentTime- the current simulation time- Returns:
- the time remaining to finish the last oversubscription delay
-
setLastOverSubscriptionDelay
public void setLastOverSubscriptionDelay(double overSubscriptionDelay) -
hasLastOverSubscriptionDelay
public boolean hasLastOverSubscriptionDelay()Returns true to indicate there is some BW or RAM oversubscription delay, false otherwise.- Returns:
- true to indicate there is some BW or RAM oversubscription delay, false otherwise
-