/** * Get total CPU utilization of all cloudlets running on this VM at the given time (in MIPS). * * @param time the time * @return total cpu utilization in MIPS * @see #getTotalUtilizationOfCpu(double) */ public double getTotalUtilizationOfCpuMips(double time) { return getTotalUtilizationOfCpu(time) * getMips(); }
/** * Gets the current requested mips. * * @return the current requested mips */ public List<Double> getCurrentRequestedMips() { List<Double> currentRequestedMips = getCloudletScheduler().getCurrentRequestedMips(); if (isBeingInstantiated()) { currentRequestedMips = new ArrayList<Double>(); for (int i = 0; i < getNumberOfPes(); i++) { currentRequestedMips.add(getMips()); } } return currentRequestedMips; }
@Override public Vm getVmToMigrate(PowerHost host) { List<PowerVm> migratableVms = getMigratableVms(host); if (migratableVms.isEmpty()) { return null; } Vm vmToMigrate = null; double minMetric = Double.MAX_VALUE; for (Vm vm : migratableVms) { if (vm.isInMigration()) { continue; } double metric = vm.getTotalUtilizationOfCpuMips(CloudSim.clock()) / vm.getMips(); if (metric < minMetric) { minMetric = metric; vmToMigrate = vm; } } return vmToMigrate; }
overallRam += ramUtilization; double cpuUtilization = (vm.getCurrentRequestedTotalMips()/vm.getMips())*100; dataList.add(new ReportData(CPU, null, brokerName, null, vmId, currentTime, cpuUtilization, currentSimulation)); overallCpu += cpuUtilization;
for (PowerHost targetHost : targetHosts) { List<Double> hostResources = resourcesMap.get(targetHost.getId()); double vmTotalMips = vm.getNumberOfPes() * vm.getMips(); if ((hostResources.get(0) + vmTotalMips) / targetHost.getTotalMips() < upperUtilizationThreshold && (hostResources.get(1) + vm.getRam()) / targetHost.getRam() < upperUtilizationThreshold) {
double vmTotalMips = vm.getNumberOfPes() * vm.getMips(); if ((hostResources.get(0) + vmTotalMips) / targetHost.getTotalMips() < upperUtilizationThreshold && (hostResources.get(1) + vm.getRam()) / targetHost.getRam() < upperUtilizationThreshold) {