public class Helper
extends java.lang.Object
| Constructor and Description |
|---|
Helper() |
| Modifier and Type | Method and Description |
|---|---|
static DatacenterBroker |
createBroker()
Creates the broker.
|
static Datacenter |
createDatacenter(java.lang.String name,
java.lang.Class<? extends Datacenter> datacenterClass,
java.util.List<PowerHost> hostList,
VmAllocationPolicy vmAllocationPolicy)
Creates the datacenter.
|
static java.util.List<PowerHost> |
createHostList(int hostsNumber)
Creates the host list.
|
static java.util.List<Vm> |
createVmList(int brokerId,
int vmsNumber)
Creates the vm list.
|
protected static java.util.Map<java.lang.String,java.lang.Double> |
getSlaMetrics(java.util.List<Vm> vms)
Gets the sla metrics.
|
protected static double |
getSlaTimePerActiveHost(java.util.List<Host> hosts)
Gets the sla time per active host.
|
protected static double |
getSlaTimePerHost(java.util.List<Host> hosts)
Gets the sla time per host.
|
static java.util.List<java.lang.Double> |
getTimesBeforeHostShutdown(java.util.List<Host> hosts)
Gets the times before host shutdown.
|
static java.util.List<java.lang.Double> |
getTimesBeforeVmMigration(java.util.List<Vm> vms)
Gets the times before vm migration.
|
static java.lang.String |
parseExperimentName(java.lang.String name)
Parses the experiment name.
|
static void |
printCloudletList(java.util.List<Cloudlet> list)
Prints the Cloudlet objects.
|
static void |
printMetricHistory(java.util.List<? extends Host> hosts,
PowerVmAllocationPolicyMigrationAbstract vmAllocationPolicy)
Prints the metric history.
|
static void |
printResults(PowerDatacenter datacenter,
java.util.List<Vm> vms,
double lastClock,
java.lang.String experimentName,
boolean outputInCsv,
java.lang.String outputFolder)
Prints the results.
|
static void |
writeDataColumn(java.util.List<? extends java.lang.Number> data,
java.lang.String outputPath)
Write data column.
|
static void |
writeDataRow(java.lang.String data,
java.lang.String outputPath)
Write data row.
|
static void |
writeMetricHistory(java.util.List<? extends Host> hosts,
PowerVmAllocationPolicyMigrationAbstract vmAllocationPolicy,
java.lang.String outputPath)
Write metric history.
|
public static java.util.List<Vm> createVmList(int brokerId, int vmsNumber)
brokerId - the broker idvmsNumber - the vms numberpublic static java.util.List<PowerHost> createHostList(int hostsNumber)
hostsNumber - the hosts numberpublic static DatacenterBroker createBroker()
public static Datacenter createDatacenter(java.lang.String name, java.lang.Class<? extends Datacenter> datacenterClass, java.util.List<PowerHost> hostList, VmAllocationPolicy vmAllocationPolicy) throws java.lang.Exception
name - the namedatacenterClass - the datacenter classhostList - the host listvmAllocationPolicy - the vm allocation policysimulationLength - java.lang.Exception - the exceptionpublic static java.util.List<java.lang.Double> getTimesBeforeHostShutdown(java.util.List<Host> hosts)
hosts - the hostspublic static java.util.List<java.lang.Double> getTimesBeforeVmMigration(java.util.List<Vm> vms)
vms - the vmspublic static void printResults(PowerDatacenter datacenter, java.util.List<Vm> vms, double lastClock, java.lang.String experimentName, boolean outputInCsv, java.lang.String outputFolder)
datacenter - the datacenterlastClock - the last clockexperimentName - the experiment nameoutputInCsv - the output in csvoutputFolder - the output folderpublic static java.lang.String parseExperimentName(java.lang.String name)
name - the nameprotected static double getSlaTimePerActiveHost(java.util.List<Host> hosts)
hosts - the hostsprotected static double getSlaTimePerHost(java.util.List<Host> hosts)
hosts - the hostsprotected static java.util.Map<java.lang.String,java.lang.Double> getSlaMetrics(java.util.List<Vm> vms)
vms - the vmspublic static void writeDataColumn(java.util.List<? extends java.lang.Number> data,
java.lang.String outputPath)
data - the dataoutputPath - the output pathpublic static void writeDataRow(java.lang.String data,
java.lang.String outputPath)
data - the dataoutputPath - the output pathpublic static void writeMetricHistory(java.util.List<? extends Host> hosts, PowerVmAllocationPolicyMigrationAbstract vmAllocationPolicy, java.lang.String outputPath)
hosts - the hostsvmAllocationPolicy - the vm allocation policyoutputPath - the output pathpublic static void printCloudletList(java.util.List<Cloudlet> list)
list - list of Cloudletspublic static void printMetricHistory(java.util.List<? extends Host> hosts, PowerVmAllocationPolicyMigrationAbstract vmAllocationPolicy)
hosts - the hostsvmAllocationPolicy - the vm allocation policy