@@ -149,17 +149,17 @@ private Double getMetricValuePostMigration(Long clusterId, Ternary<Long, Long, L
149149 return getMetricValue (clusterId , used , free , actualTotal , null );
150150 }
151151
152- private Double getImbalance (List <Double > metricList ) {
152+ private static Double getImbalance (List <Double > metricList ) {
153153 Double clusterMeanMetric = getClusterMeanMetric (metricList );
154154 Double clusterStandardDeviation = getClusterStandardDeviation (metricList , clusterMeanMetric );
155155 return clusterStandardDeviation / clusterMeanMetric ;
156156 }
157157
158- default String getClusterDrsMetric (long clusterId ) {
158+ static String getClusterDrsMetric (long clusterId ) {
159159 return ClusterDrsMetric .valueIn (clusterId );
160160 }
161161
162- default Double getMetricValue (long clusterId , long used , long free , long total , Float skipThreshold ) {
162+ static Double getMetricValue (long clusterId , long used , long free , long total , Float skipThreshold ) {
163163 boolean useRatio = getDrsMetricUseRatio (clusterId );
164164 switch (getDrsMetricType (clusterId )) {
165165 case "free" :
@@ -187,7 +187,7 @@ default Double getMetricValue(long clusterId, long used, long free, long total,
187187 * Cluster Mean Metric, mavg = (∑mi) / N, where mi is a measurable metric for a
188188 * resource ‘i’ in a cluster with total N number of resources.
189189 */
190- default Double getClusterMeanMetric (List <Double > metricList ) {
190+ static Double getClusterMeanMetric (List <Double > metricList ) {
191191 return new Mean ().evaluate (metricList .stream ().mapToDouble (i -> i ).toArray ());
192192 }
193193
@@ -202,19 +202,19 @@ default Double getClusterMeanMetric(List<Double> metricList) {
202202 * mean metric value and mi is a measurable metric for some resource ‘i’ in the
203203 * cluster with total N number of resources.
204204 */
205- default Double getClusterStandardDeviation (List <Double > metricList , Double mean ) {
205+ static Double getClusterStandardDeviation (List <Double > metricList , Double mean ) {
206206 if (mean != null ) {
207207 return new StandardDeviation (false ).evaluate (metricList .stream ().mapToDouble (i -> i ).toArray (), mean );
208208 } else {
209209 return new StandardDeviation (false ).evaluate (metricList .stream ().mapToDouble (i -> i ).toArray ());
210210 }
211211 }
212212
213- default boolean getDrsMetricUseRatio (long clusterId ) {
213+ static boolean getDrsMetricUseRatio (long clusterId ) {
214214 return ClusterDrsMetricUseRatio .valueIn (clusterId );
215215 }
216216
217- default String getDrsMetricType (long clusterId ) {
217+ static String getDrsMetricType (long clusterId ) {
218218 return ClusterDrsMetricType .valueIn (clusterId );
219219 }
220220
@@ -228,7 +228,7 @@ default String getDrsMetricType(long clusterId) {
228228 * Cluster Imbalance, Ic = σc / mavg , where σc is the standard deviation and
229229 * mavg is the mean metric value for the cluster.
230230 */
231- default Double getClusterImbalance (Long clusterId , List <Ternary <Long , Long , Long >> cpuList ,
231+ static Double getClusterImbalance (Long clusterId , List <Ternary <Long , Long , Long >> cpuList ,
232232 List <Ternary <Long , Long , Long >> memoryList , Float skipThreshold ) throws ConfigurationException {
233233 String metric = getClusterDrsMetric (clusterId );
234234 List <Double > list ;
@@ -246,7 +246,7 @@ default Double getClusterImbalance(Long clusterId, List<Ternary<Long, Long, Long
246246 return getImbalance (list );
247247 }
248248
249- default List <Double > getMetricList (Long clusterId , List <Ternary <Long , Long , Long >> hostMetricsList ,
249+ static List <Double > getMetricList (Long clusterId , List <Ternary <Long , Long , Long >> hostMetricsList ,
250250 Float skipThreshold ) {
251251 List <Double > list = new ArrayList <>();
252252 for (Ternary <Long , Long , Long > ternary : hostMetricsList ) {
0 commit comments