/** * Adds static source (<b>SDEF</b>). Static sources are the result of a consolidation function applied * to *any* other source that has been defined previously. * * @param name source name. * @param defName Name of the datasource to calculate the value from. * @param consolFun Consolidation function to use for value calculation */ public void addDatasource(String name, String defName, String consolFun) { SDef sDef = new SDef(name, defName, consolFun); sources.put(name, sDef); }
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); }
void setValue(double value) { this.value = value; int count = getTimestamps().length; double[] values = new double[count]; for (int i = 0; i < count; i++) { values[i] = value; } setValues(values); }
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); }
void setValue(double value) { this.value = value; int count = getTimestamps().length; double[] values = new double[count]; for (int i = 0; i < count; i++) { values[i] = value; } setValues(values); }
/** * <p>Adds static source (<b>SDEF</b>). Static sources are the result of a consolidation function applied * to *any* other source that has been defined previously.</p> * * @param name source name. * @param defName Name of the datasource to calculate the value from. * @param consolFun Consolidation function to use for value calculation */ public void addDatasource(String name, String defName, String consolFun) { SDef sDef = new SDef(name, defName, consolFun); sources.put(name, sDef); }