From 62a310ef68274ce1a6b9ab70bfa1597385599b37 Mon Sep 17 00:00:00 2001 From: Andreas Egger Date: Wed, 22 May 2013 14:01:44 +0200 Subject: [PATCH] Cleaned up --- .../lsdc/management/MachineManager.java | 20 +------------------ src/at/ac/tuwien/lsdc/util/NumberUtils.java | 2 -- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/src/at/ac/tuwien/lsdc/management/MachineManager.java b/src/at/ac/tuwien/lsdc/management/MachineManager.java index 1a819b3..1592316 100644 --- a/src/at/ac/tuwien/lsdc/management/MachineManager.java +++ b/src/at/ac/tuwien/lsdc/management/MachineManager.java @@ -1,13 +1,7 @@ package at.ac.tuwien.lsdc.management; -import java.math.RoundingMode; -import java.text.DecimalFormat; import java.util.Collection; import java.util.HashMap; -import java.util.List; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import at.ac.tuwien.lsdc.exception.VMsRunningException; import at.ac.tuwien.lsdc.types.PhysicalMachine; @@ -20,8 +14,6 @@ import at.ac.tuwien.lsdc.util.NumberUtils; */ public class MachineManager { - private static final Logger log = LoggerFactory.getLogger(MachineManager.class); - private HashMap PMs = new HashMap(); private int numPMs; @@ -128,20 +120,10 @@ public class MachineManager { public double getCurrentConsumption() { double consumption = 0; for (PhysicalMachine pm : PMs.values()) { - if (pm.isRunning()) { + if (pm.isRunning()) consumption += pm.getConsumption(); - - } } - consumption = NumberUtils.roundDouble(consumption); - - if(consumption < 0 || consumption > 9999) - log.info("consumptino is BIG " +consumption); - else - log.info("consumption normal "+consumption); - - return consumption; } diff --git a/src/at/ac/tuwien/lsdc/util/NumberUtils.java b/src/at/ac/tuwien/lsdc/util/NumberUtils.java index b8c6070..6eb1698 100644 --- a/src/at/ac/tuwien/lsdc/util/NumberUtils.java +++ b/src/at/ac/tuwien/lsdc/util/NumberUtils.java @@ -1,7 +1,5 @@ package at.ac.tuwien.lsdc.util; -import java.math.RoundingMode; -import java.text.DecimalFormat; public class NumberUtils { -- 2.43.0