/** * Returns all (MIN, MAX, LAST, FIRST, AVERAGE and TOTAL) aggregated values for a single datasource. * * @param sourceName Datasource name * @return Object containing all aggregated values * @throws RrdException Thrown if invalid datasource name is specified, * or if datasource values are not yet calculated (method {@link #processData()} * was not called) */ public Aggregates getAggregates(String sourceName) throws RrdException { Source source = getSource(sourceName); return source.getAggregates(tStart, tEnd); }
/** * Returns single aggregated value for a single datasource. * * @param sourceName Datasource name * @param consolFun Consolidation function to be applied to fetched datasource values. * Valid consolidation functions are MIN, MAX, LAST, FIRST, AVERAGE and TOTAL * (these string constants are conveniently defined in the {@link ConsolFuns} class) * @return MIN, MAX, LAST, FIRST, AVERAGE or TOTAL value calculated from the data * for the given datasource name * @throws RrdException Thrown if invalid datasource name is specified, * or if datasource values are not yet calculated (method {@link #processData()} * was not called) */ public double getAggregate(String sourceName, String consolFun) throws RrdException { Source source = getSource(sourceName); return source.getAggregates(tStart, tEnd).getAggregate(consolFun); }
private void calculateSDef(SDef sDef) throws RrdException { String defName = sDef.getDefName(); String consolFun = sDef.getConsolFun(); Source source = getSource(defName); if (consolFun.equals("MAXIMUM")) { consolFun = "MAX"; } else if (consolFun.equals("MINIMUM")) { consolFun = "MIN"; } double value = source.getAggregates(tStart, tEnd).getAggregate(consolFun); sDef.setValue(value); }
/** * Returns all (MIN, MAX, LAST, FIRST, AVERAGE and TOTAL) aggregated values for a single datasource. * * @param sourceName Datasource name * @return Object containing all aggregated values * @throws RrdException Thrown if invalid datasource name is specified, * or if datasource values are not yet calculated (method {@link #processData()} * was not called) */ public Aggregates getAggregates(String sourceName) throws RrdException { Source source = getSource(sourceName); return source.getAggregates(tStart, tEnd); }
/** * Returns single aggregated value for a single datasource. * * @param sourceName Datasource name * @param consolFun Consolidation function to be applied to fetched datasource values. * Valid consolidation functions are MIN, MAX, LAST, FIRST, AVERAGE and TOTAL * (these string constants are conveniently defined in the {@link ConsolFuns} class) * @return MIN, MAX, LAST, FIRST, AVERAGE or TOTAL value calculated from the data * for the given datasource name * @throws RrdException Thrown if invalid datasource name is specified, * or if datasource values are not yet calculated (method {@link #processData()} * was not called) */ public double getAggregate(String sourceName, String consolFun) throws RrdException { Source source = getSource(sourceName); return source.getAggregates(tStart, tEnd).getAggregate(consolFun); }
private void calculateSDef(SDef sDef) throws RrdException { String defName = sDef.getDefName(); String consolFun = sDef.getConsolFun(); Source source = getSource(defName); double value = source.getAggregates(tStart, tEnd).getAggregate(consolFun); sDef.setValue(value); }