/** * Realize the calculation of this definition, over the given time period * * @param tStart the time period start * @param tEnd the time period end * @throws RrdException Thrown if we cannot get a percentile value for the time period. */ public void calculate(long tStart, long tEnd) throws RrdException { if(m_source != null) { this.setValue(m_source.getPercentile(tStart, tEnd, m_percentile)); } }
/** * The same as {@link #getPercentile(String)} but with a possibility to define custom percentile boundary * (different from 95). * * @param sourceName Datasource name. * @param percentile Boundary percentile. Value of 95 (%) is suitable in most cases, but you are free * to provide your own percentile boundary between zero and 100. * @return Requested percentile of fetched source values * @throws RrdException Thrown if invalid sourcename is supplied, or if the percentile value makes no sense. */ public double getPercentile(String sourceName, double percentile) throws RrdException { if (percentile <= 0.0 || percentile > 100.0) { throw new RrdException("Invalid percentile [" + percentile + "], should be between 0 and 100"); } Source source = getSource(sourceName); return source.getPercentile(tStart, tEnd, percentile); }
/** * The same as {@link #getPercentile(String)} but with a possibility to define custom percentile boundary * (different from 95). * * @param sourceName Datasource name. * @param percentile Boundary percentile. Value of 95 (%) is suitable in most cases, but you are free * to provide your own percentile boundary between zero and 100. * @return Requested percentile of fetched source values * @throws RrdException Thrown if invalid sourcename is supplied, or if the percentile value makes no sense. */ public double getPercentile(String sourceName, double percentile) throws RrdException { if (percentile <= 0.0 || percentile > 100.0) { throw new RrdException("Invalid percentile [" + percentile + "], should be between 0 and 100"); } Source source = getSource(sourceName); return source.getPercentile(tStart, tEnd, percentile); }