void assignValues(DataProcessor dproc) throws RrdException { values = dproc.getValues(srcName); }
void assignValues(DataProcessor dproc) throws RrdException { double[] parentValues = parent.getValues(); double[] procValues = dproc.getValues(srcName); values = new double[procValues.length]; for (int i = 0; i < values.length; i++) { values[i] = parentValues[i] + procValues[i]; } }
double[] values = getValues(sourceName); double[] pixelValues = new double[pixelCount]; Arrays.fill(pixelValues, Double.NaN);
/** * Returns a set of values created by applying 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 values for <code>(x+y)/2</code> use something like: * <p> * <code>getRpnValues("x,y,+,2,/");</code> * * @param rpnExpression RRDTool-like RPN expression * @return Calculated values * @throws RrdException Thrown if invalid RPN expression is supplied */ public double[] getRpnValues(String rpnExpression) throws RrdException { DataProcessor dataProcessor = createDataProcessor(rpnExpression); return dataProcessor.getValues(RPN_SOURCE_NAME); }
/** * Returns an array of all datasource values for all datasources. Each row in this two-dimensional * array represents an array of calculated values for a single datasource. The order of rows is the same * as the order in which datasources were added to this DataProcessor object. * * @return All datasource values for all datasources. The first index is the index of the datasource, * the second index is the index of the datasource value. The number of datasource values is equal * to the number of timestamps returned with {@link #getTimestamps()} method. * @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[][] getValues() throws RrdException { String[] names = getSourceNames(); double[][] values = new double[names.length][]; for (int i = 0; i < names.length; i++) { values[i] = getValues(names[i]); } return values; }
/** * Dumps timestamps and values of all datasources in a tabelar form. Very useful for debugging. * * @return Dumped object content. * @throws RrdException Thrown if nothing is calculated so far (the method {@link #processData()} * was not called). */ public String dump() throws RrdException { String[] names = getSourceNames(); double[][] values = getValues(); StringBuilder buffer = new StringBuilder(); buffer.append(format("timestamp", 12)); for (String name : names) { buffer.append(format(name, 20)); } buffer.append("\n"); for (int i = 0; i < timestamps.length; i++) { buffer.append(format("" + timestamps[i], 12)); for (int j = 0; j < names.length; j++) { buffer.append(format(Util.formatDouble(values[j][i]), 20)); } buffer.append("\n"); } return buffer.toString(); }
void assignValues(DataProcessor dproc) throws RrdException { values = dproc.getValues(srcName); }
void assignValues(DataProcessor dproc) throws RrdException { double[] parentValues = parent.getValues(); double[] procValues = dproc.getValues(srcName); values = new double[procValues.length]; for (int i = 0; i < values.length; i++) { values[i] = parentValues[i] + procValues[i]; } }
double[] values = getValues(sourceName); double[] pixelValues = new double[pixelCount]; Arrays.fill(pixelValues, Double.NaN);
/** * Returns a set of values created by applying 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 values for <code>(x+y)/2<code> use something like: <p> * <code>getRpnValues("x,y,+,2,/");</code><p> * * @param rpnExpression RRDTool-like RPN expression * @return Calculated values * @throws RrdException Thrown if invalid RPN expression is supplied */ public double[] getRpnValues(String rpnExpression) throws RrdException { DataProcessor dataProcessor = createDataProcessor(rpnExpression); return dataProcessor.getValues(RPN_SOURCE_NAME); }
/** * Returns an array of all datasource values for all datasources. Each row in this two-dimensional * array represents an array of calculated values for a single datasource. The order of rows is the same * as the order in which datasources were added to this DataProcessor object. * * @return All datasource values for all datasources. The first index is the index of the datasource, * the second index is the index of the datasource value. The number of datasource values is equal * to the number of timestamps returned with {@link #getTimestamps()} method. * @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[][] getValues() throws RrdException { String[] names = getSourceNames(); double[][] values = new double[names.length][]; for (int i = 0; i < names.length; i++) { values[i] = getValues(names[i]); } return values; }
/** * Dumps timestamps and values of all datasources in a tabelar form. Very useful for debugging. * * @return Dumped object content. * @throws RrdException Thrown if nothing is calculated so far (the method {@link #processData()} * was not called). */ public String dump() throws RrdException { String[] names = getSourceNames(); double[][] values = getValues(); StringBuffer buffer = new StringBuffer(); buffer.append(format("timestamp", 12)); for (String name : names) { buffer.append(format(name, 20)); } buffer.append("\n"); for (int i = 0; i < timestamps.length; i++) { buffer.append(format("" + timestamps[i], 12)); for (int j = 0; j < names.length; j++) { buffer.append(format(Util.formatDouble(values[j][i]), 20)); } buffer.append("\n"); } return buffer.toString(); }
columns.put(source.getLabel(), dproc.getValues(source.getLabel()));
columns.put(source.getLabel(), dproc.getValues(source.getLabel()));
long[] timestamps = dproc.getTimestamps(); for (XPort xport : xports) { xport.values = dproc.getValues(xport.name);