本文整理汇总了Java中org.cloudbus.cloudsim.util.ExecutionTimeMeasurer类的典型用法代码示例。如果您正苦于以下问题:Java ExecutionTimeMeasurer类的具体用法?Java ExecutionTimeMeasurer怎么用?Java ExecutionTimeMeasurer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ExecutionTimeMeasurer类属于org.cloudbus.cloudsim.util包,在下文中一共展示了ExecutionTimeMeasurer类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: optimizeAllocation
import org.cloudbus.cloudsim.util.ExecutionTimeMeasurer; //导入依赖的package包/类
@Override
public List<Map<String, Object>> optimizeAllocation(
List<? extends Vm> vmList) {
ExecutionTimeMeasurer.start("optimizeAllocationTotal");
List<Map<String, Object>> migrationMap = new LinkedList<Map<String, Object>>();
// populate migrationMap here
ExecutionTimeMeasurer.start("optimizeAllocationHostSelection");
initGA();
getExecutionTimeHistoryHostSelection().add(
ExecutionTimeMeasurer.end("optimizeAllocationHostSelection"));
while(true) {
try {
migrationMap = pareto.get(rnd.nextInt(pareto.size())).getMap();
break;
} catch (Exception e) {
}
}
getExecutionTimeHistoryTotal().add(
ExecutionTimeMeasurer.end("optimizeAllocationTotal"));
return migrationMap;
}
开发者ID:hewolf,项目名称:VirtualMachinePlacement,代码行数:25,代码来源:PowerVmAllocationPolicyMigrationGA.java
示例2: optimizeAllocation
import org.cloudbus.cloudsim.util.ExecutionTimeMeasurer; //导入依赖的package包/类
/**
* Optimize allocation of the VMs according to current utilization.
*
* @param vmList the vm list
*
* @return the array list< hash map< string, object>>
*/
@Override
public List<Map<String, Object>> optimizeAllocation(List<? extends Vm> vmList) {
ExecutionTimeMeasurer.start("optimizeAllocationTotal");
ExecutionTimeMeasurer.start("optimizeAllocationHostSelection");
List<PowerHostUtilizationHistory> overUtilizedHosts = getOverUtilizedHosts();
getExecutionTimeHistoryHostSelection().add(
ExecutionTimeMeasurer.end("optimizeAllocationHostSelection"));
printOverUtilizedHosts(overUtilizedHosts);
saveAllocation();
ExecutionTimeMeasurer.start("optimizeAllocationVmSelection");
List<? extends Vm> vmsToMigrate = getVmsToMigrateFromHosts(overUtilizedHosts);
getExecutionTimeHistoryVmSelection().add(ExecutionTimeMeasurer.end("optimizeAllocationVmSelection"));
Log.printLine("Reallocation of VMs from the over-utilized hosts:");
ExecutionTimeMeasurer.start("optimizeAllocationVmReallocation");
List<Map<String, Object>> migrationMap = getNewVmPlacement(vmsToMigrate, new HashSet<Host>(
overUtilizedHosts));
getExecutionTimeHistoryVmReallocation().add(
ExecutionTimeMeasurer.end("optimizeAllocationVmReallocation"));
Log.printLine();
migrationMap.addAll(getMigrationMapFromUnderUtilizedHosts(overUtilizedHosts));
restoreAllocation();
getExecutionTimeHistoryTotal().add(ExecutionTimeMeasurer.end("optimizeAllocationTotal"));
return migrationMap;
}
开发者ID:gmartinezramirez,项目名称:Fog-Computing-Mobile-Architecture,代码行数:41,代码来源:PowerVmAllocationPolicyMigrationAbstract.java
示例3: optimizeAllocation
import org.cloudbus.cloudsim.util.ExecutionTimeMeasurer; //导入依赖的package包/类
/**
* 在PowerDatacenter.updateCloudletProcessing()函数中被调用
* Algorithm 1:VM Placement Optimization
* Optimize allocation of the VMs according to current utilization.
*
* @param vmList the vm list
*
* @return the array list< hash map< string, object>>
*/
@Override
public List<Map<String, Object>> optimizeAllocation(List<? extends Vm> vmList) {
ExecutionTimeMeasurer.start("optimizeAllocationTotal");//记录总的VPO算法执行的时间
ExecutionTimeMeasurer.start("optimizeAllocationHostSelection");//记录过载主机选择时间
//1, 遍历主机列表,取出,有过载的主机
List<PowerHostUtilizationHistory> overUtilizedHosts = getOverUtilizedHosts();
getExecutionTimeHistoryHostSelection().add(
ExecutionTimeMeasurer.end("optimizeAllocationHostSelection"));
//输出过载Host的信息
printOverUtilizedHosts(overUtilizedHosts);
//???保存当前分配状态
saveAllocation();
//2,从过载的Host中选择出迁移的虚拟机
ExecutionTimeMeasurer.start("optimizeAllocationVmSelection");
List<? extends Vm> vmsToMigrate = getVmsToMigrateFromHosts(overUtilizedHosts);
getExecutionTimeHistoryVmSelection().add(ExecutionTimeMeasurer.end("optimizeAllocationVmSelection"));
Log.printLine("Reallocation of VMs from the over-utilized hosts:");
//3,将需要迁移的虚拟机从新分配,并返回迁移的虚拟机和Host的映射表
ExecutionTimeMeasurer.start("optimizeAllocationVmReallocation");
List<Map<String, Object>> migrationMap = getNewVmPlacement(vmsToMigrate, new HashSet<Host>(
overUtilizedHosts));
getExecutionTimeHistoryVmReallocation().add(
ExecutionTimeMeasurer.end("optimizeAllocationVmReallocation"));
Log.printLine();
migrationMap.addAll(
//4,将欠载的Host中虚拟机找出来,并重新分配
getMigrationMapFromUnderUtilizedHosts(overUtilizedHosts));
restoreAllocation();
getExecutionTimeHistoryTotal().add(ExecutionTimeMeasurer.end("optimizeAllocationTotal"));
return migrationMap;
}
开发者ID:demiaowu,项目名称:annotation-of-cloudsim3.0.3,代码行数:48,代码来源:PowerVmAllocationPolicyMigrationAbstract.java
示例4: optimizeAllocation
import org.cloudbus.cloudsim.util.ExecutionTimeMeasurer; //导入依赖的package包/类
/**
* Optimize allocation of the VMs according to current utilization.
*
* @param vmList the vm list
*
* @return the array list< hash map< string, object>>
*/
@Override
public List<Map<String, Object>> optimizeAllocation(List<? extends Vm> vmList) {
ExecutionTimeMeasurer.start("optimizeAllocationTotal");
ExecutionTimeMeasurer.start("optimizeAllocationHostSelection");
List<PowerHostUtilizationHistory> overUtilizedHosts = getOverUtilizedHostsFUSD();
getExecutionTimeHistoryHostSelection().add(
ExecutionTimeMeasurer.end("optimizeAllocationHostSelection"));
printOverUtilizedHosts(overUtilizedHosts);
saveAllocation();
ExecutionTimeMeasurer.start("optimizeAllocationVmSelection");
List<? extends Vm> vmsToMigrate = getVmsToMigrateFromHosts(overUtilizedHosts);
getExecutionTimeHistoryVmSelection().add(ExecutionTimeMeasurer.end("optimizeAllocationVmSelection"));
Log.printLine("Reallocation of VMs from the over-utilized hosts:");
ExecutionTimeMeasurer.start("optimizeAllocationVmReallocation");
List<Map<String, Object>> migrationMap = getNewVmPlacement(vmsToMigrate, new HashSet<Host>(
overUtilizedHosts));
getExecutionTimeHistoryVmReallocation().add(
ExecutionTimeMeasurer.end("optimizeAllocationVmReallocation"));
Log.printLine();
migrationMap.addAll(getMigrationMapFromUnderUtilizedHosts(overUtilizedHosts));
restoreAllocation();
getExecutionTimeHistoryTotal().add(ExecutionTimeMeasurer.end("optimizeAllocationTotal"));
return migrationMap;
}
开发者ID:hewolf,项目名称:VirtualMachinePlacement,代码行数:41,代码来源:PowerVmAllocationPolicyMigrationFUSD.java
注:本文中的org.cloudbus.cloudsim.util.ExecutionTimeMeasurer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论