/** * Returns all aggregated values (MIN, MAX, LAST, FIRST, AVERAGE or TOTAL) calculated from the fetched data * for a single datasource. * * @param dsName Datasource name. * @return Simple object containing all aggregated values. * @throws RrdException Thrown if the given datasource name cannot be found in the fetched data. */ public Aggregates getAggregates(String dsName) throws RrdException { DataProcessor dataProcessor = createDataProcessor(null); return dataProcessor.getAggregates(dsName); }
/** * Returns all aggregated values for a set of values calculated by applying an RPN expression to the * fetched data. For example, if you have two datasources named <code>x</code> and <code>y</code> * in this FetchData and you want to calculate MIN, MAX, LAST, FIRST, AVERAGE and TOTAL value * of <code>(x+y)/2</code> use something like: * <p> * <code>getRpnAggregates("x,y,+,2,/");</code> * * @param rpnExpression RRDTool-like RPN expression * @return Object containing all aggregated values * @throws RrdException Thrown if invalid RPN expression is supplied * @throws IOException Thrown in case of I/O error */ public Aggregates getRpnAggregates(String rpnExpression) throws RrdException, IOException { DataProcessor dataProcessor = createDataProcessor(rpnExpression); return dataProcessor.getAggregates(RPN_SOURCE_NAME); }
Aggregates agg = dp.getAggregates("X"); System.out.println(agg.dump()); System.out.println("\nAggregates for Y"); agg = dp.getAggregates("Y"); System.out.println(agg.dump());
/** * Returns all aggregated values (MIN, MAX, LAST, FIRST, AVERAGE or TOTAL) calculated from the fetched data * for a single datasource. * * @param dsName Datasource name. * @return Simple object containing all aggregated values. * @throws RrdException Thrown if the given datasource name cannot be found in the fetched data. */ public Aggregates getAggregates(String dsName) throws RrdException { DataProcessor dataProcessor = createDataProcessor(null); return dataProcessor.getAggregates(dsName); }
/** * Returns all aggregated values for a set of values calculated by applying an RPN expression to the * fetched data. For example, if you have two datasources named <code>x</code> and <code>y</code> * in this FetchData and you want to calculate MIN, MAX, LAST, FIRST, AVERAGE and TOTAL value * of <code>(x+y)/2<code> use something like: <p> * <code>getRpnAggregates("x,y,+,2,/");</code><p> * * @param rpnExpression RRDTool-like RPN expression * @return Object containing all aggregated values * @throws RrdException Thrown if invalid RPN expression is supplied */ public Aggregates getRpnAggregates(String rpnExpression) throws RrdException, IOException { DataProcessor dataProcessor = createDataProcessor(rpnExpression); return dataProcessor.getAggregates(RPN_SOURCE_NAME); }
Aggregates agg = dp.getAggregates("X"); System.out.println(agg.dump()); System.out.println("\nAggregates for Y"); agg = dp.getAggregates("Y"); System.out.println(agg.dump());