Skip to content

Commit 37ce622

Browse files
committed
Dependency added for Apache common math lib
1 parent ed69ca0 commit 37ce622

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

components/org.apache.stratos.autoscaler/pom.xml

+5
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,11 @@
202202
<artifactId>nimbus-jose-jwt</artifactId>
203203
<version>2.26.1.wso2v2</version>
204204
</dependency>
205+
<dependency>
206+
<groupId>org.apache.commons</groupId>
207+
<artifactId>commons-math3</artifactId>
208+
<version>3.2</version>
209+
</dependency>
205210
</dependencies>
206211

207212
<build>

components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/rule/RuleTasksDelegator.java

+9-2
Original file line numberDiff line numberDiff line change
@@ -370,8 +370,15 @@ public double getLoadAveragePredictedValue(ClusterInstanceContext clusterInstanc
370370

371371
public double getLoadAveragePredictedValue(){
372372
double loadAveragePredicted = 0.0;
373-
int totalMemberCount;
374-
return 0;
373+
int totalMemberCount = 0;
374+
375+
if (totalMemberCount > 0) {
376+
log.debug("Predicted load average : " + loadAveragePredicted / totalMemberCount);
377+
return loadAveragePredicted / totalMemberCount;
378+
} else {
379+
return 0;
380+
}
381+
375382
}
376383

377384
public double getMemoryConsumptionPredictedValue(ClusterInstanceContext clusterInstanceContext) {

0 commit comments

Comments
 (0)