/** * Gets the host CPU utilization percentage IQR. * * @param host the host * @return the host CPU utilization percentage IQR */ protected double getHostUtilizationIqr(PowerHostUtilizationHistory host) throws IllegalArgumentException { double[] data = host.getUtilizationHistory(); if (MathUtil.countNonZeroBeginning(data) >= 12) { // 12 has been suggested as a safe value return MathUtil.iqr(data); } throw new IllegalArgumentException(); }
/** * Computes the host utilization IRQ used for generating the host over utilization threshold. * * @param host the host * @return the host CPU utilization percentage IQR */ @Override public double computeHostUtilizationMeasure(final Host host) throws IllegalArgumentException { final double[] cpuUsageArray = getHostCpuUsageArray(host); if (MathUtil.countNonZeroBeginning(cpuUsageArray) >= MIN_HISTORY_ENTRIES_FOR_IRQ) { return MathUtil.iqr(cpuUsageArray); } throw new IllegalArgumentException("There is not enough Host history to compute Host utilization IRQ"); }