@Override public void shutdownEntity() { Log.printConcatLine(getName(), " is shutting down..."); }
/** * Process non-default received events that aren't processed by * the {@link #processEvent(org.cloudbus.cloudsim.core.SimEvent)} method. * This method should be overridden by subclasses in other to process * new defined events. * * @param ev information about the event just happened * * @pre $none * @post $none */ protected void processOtherEvent(SimEvent ev) { if (ev == null) { Log.printConcatLine(getName(), ".processOtherEvent(): Error - an event is null."); } }
/** * Gets the CPU utilization rate of a host. * * @param host the host to be analyzed. * @since 1.0 */ public static double getHostCpuUtilizationRate(PowerHost host) { double cpuUtilizationRate = getHostCpuUtilization(host) / host.getTotalMips(); List<Double> previousValuesCpu = Simulation.getDataCollector().getMonitoredUsedResources(host.getDatacenter().getName(), host.getId(), "CPU"); for (Double previousValue : previousValuesCpu) { cpuUtilizationRate += (previousValue / 100); } cpuUtilizationRate /= (previousValuesCpu.size() + 1); return cpuUtilizationRate; }
/** * Gets the RAM utilization rate of a host. * * @param host the host to be analyzed. * @since 1.0 */ public static double getHostRamUtilizationRate(PowerHost host) { double ramUtilizationRate = getHostRamUtilization(host) / host.getRam(); List<Double> previousValuesRam = Simulation.getDataCollector().getMonitoredUsedResources(host.getDatacenter().getName(), host.getId(), "RAM"); for (Double previousValue : previousValuesRam) { ramUtilizationRate += (previousValue / 100); } ramUtilizationRate /= (previousValuesRam.size() + 1); return ramUtilizationRate; }
@Override public void startEntity() { Log.printConcatLine(getName(), " is starting..."); // this resource should register to regional CIS. // However, if not specified, then register to system CIS (the // default CloudInformationService) entity. int gisID = CloudSim.getEntityId(regionalCisName); if (gisID == -1) { gisID = CloudSim.getCloudInfoServiceEntityId(); } // send the registration to CIS sendNow(gisID, CloudSimTags.REGISTER_RESOURCE, getId()); // Below method is for a child class to override registerOtherEntity(); }
.getCloudletScheduler().getCloudletStatus(cloudletId); } catch (Exception e) { Log.printConcatLine(getName(), ": Error in processing CloudSimTags.CLOUDLET_STATUS"); Log.printLine(e.getMessage()); return; Log.printConcatLine(getName(), ": Error in processing CloudSimTags.CLOUDLET_STATUS"); Log.printLine(e.getMessage()); return;
/** * Creates a new migration registry. * * @param vmAllocationPolicy the virtual machine allocation policy. * @param targetHost the target host. * @param sourceHost the source host. * @param vm the virtual machine. * @param currentSimulation the id of the current simulation. * @since 1.0 */ public Migration(VmAllocationPolicy vmAllocationPolicy, PowerHost targetHost, PowerHost sourceHost, Vm vm, int currentSimulation) { this.vmAllocationPolicy = vmAllocationPolicy; this.targetHost = targetHost; this.sourceHost = sourceHost; this.vm = vm; this.simulationId = currentSimulation; this.targetHostLabel = "Host" + targetHost.getId(); this.sourceHostLabel = "Host" + sourceHost.getId(); this.vmLabel = "VM" + vm.getUid(); this.datacenterName = targetHost.getDatacenter().getName(); this.sourceHostCpuUtilization = sourceHost.getUtilizationOfCpuMips(); this.sourceHostRamUtilization = sourceHost.getUtilizationOfRam(); this.sourceHostPowerConsumption = sourceHost.getPower()/sourceHost.getMaxPower(); this.targetHostCpuUtilization = targetHost.getUtilizationOfCpuMips(); this.targetHostRamUtilization = targetHost.getUtilizationOfRam(); this.targetHostPowerConsumption = targetHost.getPower()/targetHost.getMaxPower(); }
Log.printConcatLine(getName(), ": Warning - Cloudlet #", cl.getCloudletId(), " owned by ", name, " is already completed/finished."); Log.printLine("Therefore, it is not being executed again"); Log.printLine(getName() + ".processCloudletSubmit(): " + "ClassCastException error."); c.printStackTrace(); } catch (Exception e) { Log.printLine(getName() + ".processCloudletSubmit(): " + "Exception error."); e.printStackTrace();