@Test public void testGetHighestHostPowerUsage() { System.out.println("getHighestHostPowerUsage"); Host host = CHOSEN_HOST; ZabbixDataSourceAdaptor instance = new ZabbixDataSourceAdaptor(); double result = instance.getHighestHostPowerUsage(host); assert(result > 0.0); System.out.println("Highest Host Power Usage: " + result); }
@Override public double getHighestHostPowerUsage(eu.ascetic.asceticarchitecture.iaas.energymodeller.types.energyuser.Host host) { List<HistoryItem> energyData = client.getHistoryDataFromItem(POWER_KPI_NAME, host.getHostName(), Dictionary.HISTORY_ITEM_FORMAT_FLOAT, 200); double highestValue = Double.MIN_VALUE; for (HistoryItem historyItem : energyData) { double current = Double.parseDouble(historyItem.getValue()); if (current > highestValue) { highestValue = current; } } return highestValue; }
ZabbixDataSourceAdaptor implements HostDataSource { @Override public double getHighestHostPowerUsage(eu.ascetic.asceticarchitecture.iaas.energymodeller.types.energyuser.Host host) { List<HistoryItem> energyData = client.getHistoryDataFromItem(POWER_KPI_NAME, host.getHostName(), Dictionary.HISTORY_ITEM_FORMAT_FLOAT, 200); double highestValue = Double.MIN_VALUE; for (HistoryItem historyItem : energyData) { double current = Double.parseDouble(historyItem.getValue()); if (current > highestValue) { highestValue = current; } } return highestValue; } }
ZabbixDataSourceAdaptor implements HostDataSource { @Override public double getHighestHostPowerUsage(eu.ascetic.asceticarchitecture.iaas.energymodeller.types.energyuser.Host host) { List<HistoryItem> energyData = client.getHistoryDataFromItem(POWER_KPI_NAME, host.getHostName(), Dictionary.HISTORY_ITEM_FORMAT_FLOAT, 200); double highestValue = Double.MIN_VALUE; for (HistoryItem historyItem : energyData) { double current = Double.parseDouble(historyItem.getValue()); if (current > highestValue) { highestValue = current; } } return highestValue; }  }
ZabbixDataSourceAdaptor implements HostDataSource { @Override public double getHighestHostPowerUsage(eu.ascetic.asceticarchitecture.iaas.energymodeller.types.energyuser.Host host) { List<HistoryItem> energyData = client.getHistoryDataFromItem(POWER_KPI_NAME, host.getHostName(), Dictionary.HISTORY_ITEM_FORMAT_FLOAT, 200); double highestValue = Double.MIN_VALUE; for (HistoryItem historyItem : energyData) { double current = Double.parseDouble(historyItem.getValue()); if (current > highestValue) { highestValue = current; } } return highestValue; }  static void main(String[] args); @Override eu.ascetic.asceticarchitecture.iaas.energymodeller.types.energyuser.Host getHostByName(String hostname); @Override GeneralPurposePowerConsumer getGeneralPowerConsumerByName(String hostname); @Override VmDeployed getVmByName(String name); @Override List<eu.ascetic.asceticarchitecture.iaas.energymodeller.types.energyuser.Host> getHostList(); List<eu.ascetic.asceticarchitecture.iaas.energymodeller.types.energyuser.Host> getHostList(String groupName); @Override List<GeneralPurposePowerConsumer> getGeneralPowerConsumerList(); @Override List<VmDeployed> getVmList(); List<VmDeployed> getVmList(String groupName); @Override List<EnergyUsageSource> getHostAndVmList(); @Override List<HostMeasurement> getHostData(); @Override HostMeasurement getHostData(eu.ascetic.asceticarchitecture.iaas.energymodeller.types.energyuser.Host host); @Override List<HostMeasurement> getHostData(List<eu.ascetic.asceticarchitecture.iaas.energymodeller.types.energyuser.Host> hostList); @Override List<VmMeasurement> getVmData(); @Override VmMeasurement getVmData(VmDeployed vm); @Override List<VmMeasurement> getVmData(List<VmDeployed> vmList); ZabbixClient getClient(); void setClient(ZabbixClient client); @Override CurrentUsageRecord getCurrentEnergyUsage(eu.ascetic.asceticarchitecture.iaas.energymodeller.types.energyuser.Host host); @Override double getLowestHostPowerUsage(eu.ascetic.asceticarchitecture.iaas.energymodeller.types.energyuser.Host host); @Override double getHighestHostPowerUsage(eu.ascetic.asceticarchitecture.iaas.energymodeller.types.energyuser.Host host); @Override double getCpuUtilisation(eu.ascetic.asceticarchitecture.iaas.energymodeller.types.energyuser.Host host, int lastNSeconds); ZabbixHostVMFilter getHostFilter(); void setHostFilter(ZabbixHostVMFilter hostFilter); }
ZabbixDataSourceAdaptor implements HostDataSource { @Override public double getHighestHostPowerUsage(eu.ascetic.asceticarchitecture.iaas.energymodeller.types.energyuser.Host host) { List<HistoryItem> energyData = client.getHistoryDataFromItem(POWER_KPI_NAME, host.getHostName(), Dictionary.HISTORY_ITEM_FORMAT_FLOAT, 200); double highestValue = Double.MIN_VALUE; for (HistoryItem historyItem : energyData) { double current = Double.parseDouble(historyItem.getValue()); if (current > highestValue) { highestValue = current; } } return highestValue; }  static void main(String[] args); @Override eu.ascetic.asceticarchitecture.iaas.energymodeller.types.energyuser.Host getHostByName(String hostname); @Override GeneralPurposePowerConsumer getGeneralPowerConsumerByName(String hostname); @Override VmDeployed getVmByName(String name); @Override List<eu.ascetic.asceticarchitecture.iaas.energymodeller.types.energyuser.Host> getHostList(); List<eu.ascetic.asceticarchitecture.iaas.energymodeller.types.energyuser.Host> getHostList(String groupName); @Override List<GeneralPurposePowerConsumer> getGeneralPowerConsumerList(); @Override List<VmDeployed> getVmList(); List<VmDeployed> getVmList(String groupName); @Override List<EnergyUsageSource> getHostAndVmList(); @Override List<HostMeasurement> getHostData(); @Override HostMeasurement getHostData(eu.ascetic.asceticarchitecture.iaas.energymodeller.types.energyuser.Host host); @Override List<HostMeasurement> getHostData(List<eu.ascetic.asceticarchitecture.iaas.energymodeller.types.energyuser.Host> hostList); @Override List<VmMeasurement> getVmData(); @Override VmMeasurement getVmData(VmDeployed vm); @Override List<VmMeasurement> getVmData(List<VmDeployed> vmList); ZabbixClient getClient(); void setClient(ZabbixClient client); @Override CurrentUsageRecord getCurrentEnergyUsage(eu.ascetic.asceticarchitecture.iaas.energymodeller.types.energyuser.Host host); @Override double getLowestHostPowerUsage(eu.ascetic.asceticarchitecture.iaas.energymodeller.types.energyuser.Host host); @Override double getHighestHostPowerUsage(eu.ascetic.asceticarchitecture.iaas.energymodeller.types.energyuser.Host host); @Override double getCpuUtilisation(eu.ascetic.asceticarchitecture.iaas.energymodeller.types.energyuser.Host host, int lastNSeconds); ZabbixHostVMFilter getHostFilter(); void setHostFilter(ZabbixHostVMFilter hostFilter);  }