@Test(enabled = TestConstants.EnabledTest) public void testPerformanceComplete() { optimizer = new Optimizer(); log.info("=== TEST for PERFORMANCE of optimizer STARTED ==="); long startTime = System.currentTimeMillis(); optimizer.optimize(appModel, suitableCloudOffer); long finishTime = System.currentTimeMillis(); log.debug("Optimizer execution time= " + (((double) (finishTime - startTime)) / 1000.0) + " seconds"); Assert.assertTrue( "Otimizer does not have good Performance. More than " + ((double) TestConstants.MAX_MILLIS_EXECUTING) / 1000.1 + " seconds", (finishTime - startTime) < TestConstants.MAX_MILLIS_EXECUTING); log.info("=== TEST for PERFORMANCE of optimizer FINISHED==="); }
public String[] optimize(String appModel, String suitableCloudOffer, String benchmarkPlatforms) { String[] outputPlans = new String[NUMBER_OF_PLANS_GENERATED]; outputPlans[0] = "Plan generation was not possible"; if (previousPlans == null) { OptimizerInitialDeployment initialOptimizer = new OptimizerInitialDeployment(searchName); try { outputPlans = initialOptimizer.optimize(appModel, MMtoOptModelTransformer.transformModel(suitableCloudOffer), benchmarkPlatforms, NUMBER_OF_PLANS_GENERATED,HYSTERESIS_PROPORTION); previousPlans = outputPlans; } catch (Exception exc) { log.warn( "Optimizer did not work in its expected input. Exception name was " + exc.getClass().getName() +" Trying with the assumption of former versions of Input "); outputPlans = initialOptimizer.optimize(appModel, suitableCloudOffer, benchmarkPlatforms, NUMBER_OF_PLANS_GENERATED,HYSTERESIS_PROPORTION); previousPlans = outputPlans; } catch (Error E) { log.error("Error optimizing the initial deployment"); E.printStackTrace(); } } else { } return outputPlans; }
Optimizer { public String[] optimize(String appModel, String suitableCloudOffer, String benchmarkPlatforms) { String[] outputPlans = new String[NUMBER_OF_PLANS_GENERATED]; outputPlans[0] = "Plan generation was not possible"; if (previousPlans == null) { OptimizerInitialDeployment initialOptimizer = new OptimizerInitialDeployment(searchName); try { outputPlans = initialOptimizer.optimize(appModel, MMtoOptModelTransformer.transformModel(suitableCloudOffer), benchmarkPlatforms, NUMBER_OF_PLANS_GENERATED,HYSTERESIS_PROPORTION); previousPlans = outputPlans; } catch (Exception exc) { log.warn( "Optimizer did not work in its expected input. Exception name was " + exc.getClass().getName() +" Trying with the assumption of former versions of Input "); outputPlans = initialOptimizer.optimize(appModel, suitableCloudOffer, benchmarkPlatforms, NUMBER_OF_PLANS_GENERATED,HYSTERESIS_PROPORTION); previousPlans = outputPlans; } catch (Error E) { log.error("Error optimizing the initial deployment"); E.printStackTrace(); } } else { } return outputPlans; } }
Optimizer { public String[] optimize(String appModel, String suitableCloudOffer, String benchmarkPlatforms) { String[] outputPlans = new String[NUMBER_OF_PLANS_GENERATED]; outputPlans[0] = "Plan generation was not possible"; if (previousPlans == null) { OptimizerInitialDeployment initialOptimizer = new OptimizerInitialDeployment(searchName); try { outputPlans = initialOptimizer.optimize(appModel, MMtoOptModelTransformer.transformModel(suitableCloudOffer), benchmarkPlatforms, NUMBER_OF_PLANS_GENERATED,HYSTERESIS_PROPORTION); previousPlans = outputPlans; } catch (Exception exc) { log.warn( "Optimizer did not work in its expected input. Exception name was " + exc.getClass().getName() +" Trying with the assumption of former versions of Input "); outputPlans = initialOptimizer.optimize(appModel, suitableCloudOffer, benchmarkPlatforms, NUMBER_OF_PLANS_GENERATED,HYSTERESIS_PROPORTION); previousPlans = outputPlans; } catch (Error E) { log.error("Error optimizing the initial deployment"); E.printStackTrace(); } } else { } return outputPlans; } Optimizer();  Optimizer(int num);  Optimizer(SearchMethodName name);  Optimizer(int num, SearchMethodName name);  Optimizer(int num, SearchMethodName name, double hysteresis); }
Optimizer { public String[] optimize(String appModel, String suitableCloudOffer, String benchmarkPlatforms) { String[] outputPlans = new String[NUMBER_OF_PLANS_GENERATED]; outputPlans[0] = "Plan generation was not possible"; if (previousPlans == null) { OptimizerInitialDeployment initialOptimizer = new OptimizerInitialDeployment(searchName); try { outputPlans = initialOptimizer.optimize(appModel, MMtoOptModelTransformer.transformModel(suitableCloudOffer), benchmarkPlatforms, NUMBER_OF_PLANS_GENERATED,HYSTERESIS_PROPORTION); previousPlans = outputPlans; } catch (Exception exc) { log.warn( "Optimizer did not work in its expected input. Exception name was " + exc.getClass().getName() +" Trying with the assumption of former versions of Input "); outputPlans = initialOptimizer.optimize(appModel, suitableCloudOffer, benchmarkPlatforms, NUMBER_OF_PLANS_GENERATED,HYSTERESIS_PROPORTION); previousPlans = outputPlans; } catch (Error E) { log.error("Error optimizing the initial deployment"); E.printStackTrace(); } } else { } return outputPlans; } Optimizer();  Optimizer(int num);  Optimizer(SearchMethodName name);  Optimizer(int num, SearchMethodName name);  Optimizer(int num, SearchMethodName name, double hysteresis); String[] optimize(String appModel, String suitableCloudOffer, String benchmarkPlatforms); String[] optimize(String appModel, String suitableCloudOffer); }
Optimizer { public String[] optimize(String appModel, String suitableCloudOffer, String benchmarkPlatforms) { String[] outputPlans = new String[NUMBER_OF_PLANS_GENERATED]; outputPlans[0] = "Plan generation was not possible"; if (previousPlans == null) { OptimizerInitialDeployment initialOptimizer = new OptimizerInitialDeployment(searchName); try { outputPlans = initialOptimizer.optimize(appModel, MMtoOptModelTransformer.transformModel(suitableCloudOffer), benchmarkPlatforms, NUMBER_OF_PLANS_GENERATED,HYSTERESIS_PROPORTION); previousPlans = outputPlans; } catch (Exception exc) { log.warn( "Optimizer did not work in its expected input. Exception name was " + exc.getClass().getName() +" Trying with the assumption of former versions of Input "); outputPlans = initialOptimizer.optimize(appModel, suitableCloudOffer, benchmarkPlatforms, NUMBER_OF_PLANS_GENERATED,HYSTERESIS_PROPORTION); previousPlans = outputPlans; } catch (Error E) { log.error("Error optimizing the initial deployment"); E.printStackTrace(); } } else { } return outputPlans; } Optimizer();  Optimizer(int num);  Optimizer(SearchMethodName name);  Optimizer(int num, SearchMethodName name);  Optimizer(int num, SearchMethodName name, double hysteresis); String[] optimize(String appModel, String suitableCloudOffer, String benchmarkPlatforms); String[] optimize(String appModel, String suitableCloudOffer);  }