/** * Used by ISPs which charge for bandwidth utilization on a "95th percentile" basis. * <p> * The 95th percentile is the highest source value left when the top 5% of a numerically sorted set * of source data is discarded. It is used as a measure of the peak value used when one discounts * a fair amount for transitory spikes. This makes it markedly different from the average. * <p> * Read more about this topic at * <a href="http://www.red.net/support/resourcecentre/leasedline/percentile.php">Rednet</a> or * <a href="http://www.bytemark.co.uk/support/tech/95thpercentile.html">Bytemark</a>. * * @param sourceName Datasource name * @return 95th percentile of fetched source values * @throws RrdException Thrown if invalid source name is supplied */ public double getPercentile(String sourceName) throws RrdException { return getPercentile(sourceName, DEFAULT_PERCENTILE); }
/** * This method is just an alias for {@link #getPercentile(String)} method. * <p> * Used by ISPs which charge for bandwidth utilization on a "95th percentile" basis. * <p> * The 95th percentile is the highest source value left when the top 5% of a numerically sorted set * of source data is discarded. It is used as a measure of the peak value used when one discounts * a fair amount for transitory spikes. This makes it markedly different from the average. * <p> * Read more about this topic at * <a href="http://www.red.net/support/resourcecentre/leasedline/percentile.php">Rednet</a> or * <a href="http://www.bytemark.co.uk/support/tech/95thpercentile.html">Bytemark</a>. * * @param sourceName Datasource name * @return 95th percentile of fetched source values * @throws RrdException Thrown if invalid source name is supplied */ public double get95Percentile(String sourceName) throws RrdException { return getPercentile(sourceName); }
/** * Used by ISPs which charge for bandwidth utilization on a "95th percentile" basis.<p> * <p/> * The 95th percentile is the highest source value left when the top 5% of a numerically sorted set * of source data is discarded. It is used as a measure of the peak value used when one discounts * a fair amount for transitory spikes. This makes it markedly different from the average.<p> * <p/> * Read more about this topic at * <a href="http://www.red.net/support/resourcecentre/leasedline/percentile.php">Rednet</a> or * <a href="http://www.bytemark.co.uk/support/tech/95thpercentile.html">Bytemark</a>. * * @param sourceName Datasource name * @return 95th percentile of fetched source values * @throws RrdException Thrown if invalid source name is supplied */ public double getPercentile(String sourceName) throws RrdException { return getPercentile(sourceName, DEFAULT_PERCENTILE); }
/** * This method is just an alias for {@link #getPercentile(String)} method. * <p/> * Used by ISPs which charge for bandwidth utilization on a "95th percentile" basis.<p> * <p/> * The 95th percentile is the highest source value left when the top 5% of a numerically sorted set * of source data is discarded. It is used as a measure of the peak value used when one discounts * a fair amount for transitory spikes. This makes it markedly different from the average.<p> * <p/> * Read more about this topic at * <a href="http://www.red.net/support/resourcecentre/leasedline/percentile.php">Rednet</a> or * <a href="http://www.bytemark.co.uk/support/tech/95thpercentile.html">Bytemark</a>. * * @param sourceName Datasource name * @return 95th percentile of fetched source values * @throws RrdException Thrown if invalid source name is supplied */ public double get95Percentile(String sourceName) throws RrdException { return getPercentile(sourceName); }
protected void addVdefDs(RrdGraphDef graphDef, String sourceName, String[] rhs, double start, double end, Map<String,List<String>> defs) throws RrdException { if (rhs.length == 2) { graphDef.datasource(sourceName, rhs[0], rhs[1]); } else if (rhs.length == 3 && "PERCENT".equals(rhs[2])) { // Is there a better way to do this than with a separate DataProcessor? final double pctRank = Double.valueOf(rhs[1]); final DataProcessor dataProcessor = new DataProcessor((int)start, (int)end); for (final Entry<String, List<String>> entry : defs.entrySet()) { final String dsName = entry.getKey(); final List<String> thisDef = entry.getValue(); if (thisDef.size() == 3) { dataProcessor.addDatasource(dsName, thisDef.get(0), thisDef.get(1), thisDef.get(2)); } else if (thisDef.size() == 1) { dataProcessor.addDatasource(dsName, thisDef.get(0)); } } try { dataProcessor.processData(); } catch (IOException e) { throw new RrdException("Caught IOException: " + e.getMessage()); } double result = dataProcessor.getPercentile(rhs[0], pctRank); ConstantStaticDef csDef = new ConstantStaticDef((long)start, (long)end, result); graphDef.datasource(sourceName, csDef); } }