Esempio n. 1
0
 public int compare(HostData o1, HostData o2) {
   double compare =
       o1.getHostDescription().getPowerEfficiency()
           - o2.getHostDescription().getPowerEfficiency();
   if (compare < 0) return -1;
   else if (compare > 0) return 1;
   return 0;
 }
Esempio n. 2
0
 public int compare(HostData o1, HostData o2) {
   double compare =
       o1.getHostDescription().getResourceCapacity().getBandwidth()
           - o2.getHostDescription().getResourceCapacity().getBandwidth();
   if (compare < 0) return -1;
   else if (compare > 0) return 1;
   return 0;
 }
Esempio n. 3
0
 public int compare(HostData o1, HostData o2) {
   double compare =
       (o1.getCurrentStatus().getResourcesInUse().getCpu()
               / o1.getHostDescription().getResourceCapacity().getCpu())
           - (o2.getCurrentStatus().getResourcesInUse().getCpu()
               / o2.getHostDescription().getResourceCapacity().getCpu());
   if (compare < 0) return -1;
   else if (compare > 0) return 1;
   return 0;
 }
Esempio n. 4
0
        public double calculate(HostData host) {
          ArrayList<VmAllocation> vms =
              new ArrayList<VmAllocation>(host.getHost().getVMAllocations());
          vms.add(host.getHost().getPrivDomainAllocation());

          int cpu = 0;
          int mem = 0;
          double bw = 0;
          for (VmAllocation vm : vms) {
            // If the VMAllocation has an associated VM, record its resource allocation.
            if (vm.getVm() != null) cpu += vm.getCpu();
            mem += vm.getMemory();
            bw += vm.getBandwidth();
          }

          Resources res = host.getHostDescription().getResourceCapacity();
          return (cpu * mem * bw) / (res.getCpu() * res.getMemory() * res.getBandwidth());
        }
Esempio n. 5
0
 public int compare(HostData o1, HostData o2) {
   return o1.getHostDescription().getResourceCapacity().getMemory()
       - o2.getHostDescription().getResourceCapacity().getMemory();
 }
Esempio n. 6
0
 public int compare(HostData o1, HostData o2) {
   return o1.getHostDescription().getCoreCapacity() - o2.getHostDescription().getCoreCapacity();
 }
Esempio n. 7
0
 public int compare(HostData o1, HostData o2) {
   return o1.getHostDescription().getCpuCount() * o1.getHostDescription().getCoreCount()
       - o2.getHostDescription().getCpuCount() * o2.getHostDescription().getCoreCount();
 }