From f363908faf05f9ed6a44b964c6df97fb46c8707d Mon Sep 17 00:00:00 2001 From: i-akash Date: Tue, 10 Nov 2020 13:30:56 +0600 Subject: [PATCH] WeightedMovingAverage : recent parameters in parameterList should get more weight. So as weight is in increasing order, parameterList should maintain order of history list that is recent history in last. WeightedMovingAverageFibonacci : recent parameters in parameterList should get more weight. So as weight is in increasing order, parameterList should maintain order of history list that is recent history in last. --- .../autoscaling/Analyzer.java | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/autoscalesim/applicationprovider/autoscaling/Analyzer.java b/src/autoscalesim/applicationprovider/autoscaling/Analyzer.java index ef8f665..679f718 100644 --- a/src/autoscalesim/applicationprovider/autoscaling/Analyzer.java +++ b/src/autoscalesim/applicationprovider/autoscaling/Analyzer.java @@ -86,7 +86,7 @@ public void doAnalysis(){ // RESOURCE-AWARE cpuUtilization = ANLZ_CPUUtil(); vmCount = ANLZ_VMCount(); - throughput = ANLZL_Throughput(); + throughput = ANLZ_Throughput(); // SLA-AWARE responseTime = ANLZ_ResponseTime(); @@ -139,7 +139,7 @@ private double ANLZ_CPUUtil(){ double parameterList[] = new double[window]; for(int i = 0; i< window;i++){ - parameterList[i] = tmpVmHistoryList.get(sizeVmHistory - 1 - i).getCpuUtilizationByAllTier(); + parameterList[i] = tmpVmHistoryList.get(sizeVmHistory - (window-i)).getCpuUtilizationByAllTier(); } @@ -198,7 +198,7 @@ private double ANLZ_VMCount(){ double parameterList[] = new double[window]; for(int i = 0; i< window;i++){ - parameterList[i] = tmpVmHistoryList.get(sizeVmHistory - 1 - i).getVms(); + parameterList[i] = tmpVmHistoryList.get(sizeVmHistory - (window-i)).getVms(); } @@ -257,7 +257,7 @@ private double ANLZ_Throughput(){ double parameterList[] = new double[window]; for(int i = 0; i< window;i++){ - parameterList[i] = tmpVmHistoryList.get(sizeVmHistory - 1 - i).getThroughputFinishedCloudletsAllTiers(); + parameterList[i] = tmpVmHistoryList.get(sizeVmHistory - (window-i)).getThroughputFinishedCloudletsAllTiers(); } @@ -316,7 +316,7 @@ private double ANLZ_ResponseTime(){ double parameterList[] = new double[window]; for(int i = 0; i< window;i++){ - parameterList[i] = tmpSLAHistoryList.get(sizeSLAHistory - 1 - i).getAvgResponseTimePerAllTiers(); + parameterList[i] = tmpSLAHistoryList.get(sizeSLAHistory - (window-i)).getAvgResponseTimePerAllTiers(); } @@ -375,7 +375,7 @@ private double ANLZ_DelayTime(){ double parameterList[] = new double[window]; for(int i = 0; i< window;i++){ - parameterList[i] = tmpSLAHistoryList.get(sizeSLAHistory - 1 - i).getAvgDelayTimePerAllTiers(); + parameterList[i] = tmpSLAHistoryList.get(sizeSLAHistory - (window-i)).getAvgDelayTimePerAllTiers(); } @@ -434,7 +434,7 @@ private double ANLZ_SLAVCount(){ double parameterList[] = new double[window]; for(int i = 0; i< window;i++){ - parameterList[i] = tmpSLAHistoryList.get(sizeSLAHistory - 1 - i).getSlavNumberByAllTier(); + parameterList[i] = tmpSLAHistoryList.get(sizeSLAHistory - (window-i)).getSlavNumberByAllTier(); } @@ -494,7 +494,7 @@ private double ANLZ_SLAVPercentage(){ double parameterList[] = new double[window]; for(int i = 0; i< window;i++){ - parameterList[i] = tmpSLAHistoryList.get(sizeSLAHistory - 1 - i).getSlavPercent(); + parameterList[i] = tmpSLAHistoryList.get(sizeSLAHistory - (window-i)).getSlavPercent(); } @@ -553,7 +553,7 @@ private double ANLZ_SLAVTime(){ double parameterList[] = new double[window]; for(int i = 0; i< window;i++){ - parameterList[i] = tmpSLAHistoryList.get(sizeSLAHistory - 1 - i).getSlavSecondByAlltier(); + parameterList[i] = tmpSLAHistoryList.get(sizeSLAHistory - (window-i)).getSlavSecondByAlltier(); } @@ -613,7 +613,7 @@ private double ANLZ_FailedCloudlet(){ double parameterList[] = new double[window]; for(int i = 0; i< window;i++){ - parameterList[i] = tmpSLAHistoryList.get(sizeSLAHistory - 1 - i).getCloudletFailedCounter(); + parameterList[i] = tmpSLAHistoryList.get(sizeSLAHistory - (window-i)).getCloudletFailedCounter(); } @@ -674,8 +674,11 @@ private double ANLZ_FutureWorkload(){ double parameterList[] = new double[window]; for(int i = 0; i< window;i++){ - parameterList[i] = tmpEndUserHistoryList.get(sizeEndUserHistory - 1 - i).getRequestsPerAllTier(); +// parameterList[i] = tmpEndUserHistoryList.get(sizeEndUserHistory - 1 - i).getRequestsPerAllTier(); + parameterList[i] = tmpEndUserHistoryList.get(sizeEndUserHistory - (window-i)).getRequestsPerAllTier(); + } + //Index 9 of AnalysisMethod variable indicates the analyzing method for analyzing 'Future Workload'