/** * Sets this Cloudlet's execution parameters. These parameters are set by the CloudResource * before departure or sending back to the original Cloudlet's owner. * * @param wallClockTime the time of this Cloudlet resides in a CloudResource (from arrival time * until departure time). * @param actualCPUTime the total execution time of this Cloudlet in a CloudResource. * @pre wallClockTime >= 0.0 * @pre actualCPUTime >= 0.0 * @post $none */ public void setExecParam(double wallClockTime, double actualCPUTime) { cloudlet.setExecParam(wallClockTime, actualCPUTime); }
/** * Finalizes all relevant information before <tt>exiting</tt> the CloudResource entity. This * method sets the final data of: * <ul> * <li>wall clock time, i.e. the time of this Cloudlet resides in a CloudResource (from arrival * time until departure time). * <li>actual CPU time, i.e. the total execution time of this Cloudlet in a CloudResource. * <li>Cloudlet's finished time so far * </ul> * * @pre $none * @post $none */ public void finalizeCloudlet() { // Sets the wall clock time and actual CPU time double wallClockTime = CloudSim.clock() - arrivalTime; cloudlet.setExecParam(wallClockTime, totalCompletionTime); long finished = 0; //if (cloudlet.getCloudletTotalLength() * Consts.MILLION < cloudletFinishedSoFar) { if (cloudlet.getCloudletStatus()==Cloudlet.SUCCESS) { finished = cloudlet.getCloudletLength(); } else { finished = cloudletFinishedSoFar / Consts.MILLION; } cloudlet.setCloudletFinishedSoFar(finished); }