/** * Returns the number of archive steps. * * @return Number of archive steps. * @throws java.io.IOException Thrown in case of I/O error. */ public int getSteps() throws IOException { return steps.get(); }
/** * Returns the number of archive rows. * * @return Number of archive rows. * @throws java.io.IOException Thrown in case of I/O error. */ public int getRows() throws IOException { return rows.get(); }
/** * Returns the number of archive rows. * * @return Number of archive rows. * @throws IOException Thrown in case of I/O error. */ public int getRows() throws IOException { return rows.get(); }
/** * Returns the number of datasources defined in the RRD. * * @return Number of datasources defined * @throws java.io.IOException Thrown in case of I/O error */ public int getDsCount() throws IOException { return dsCount.get(); }
/** * Returns the number of archives defined in the RRD. * * @return Number of archives defined * @throws java.io.IOException Thrown in case of I/O error */ public int getArcCount() throws IOException { return arcCount.get(); }
/** * Returns the i-th value from the Robin archive. * * @param index Value index * @return Value stored in the i-th position (the oldest value has zero index) * @throws IOException Thrown in case of I/O specific error. */ public double getValue(int index) throws IOException { int arrayIndex = (pointer.get() + index) % rows; return values.get(column, arrayIndex); }
/** * {@inheritDoc} * * Returns the i-th value from the Robin archive. */ public double getValue(int index) throws IOException { int arrayIndex = (pointer.get() + index) % rows; return values.get(column, arrayIndex); }
/** * {@inheritDoc} * * Sets the i-th value in the Robin archive. */ public void setValue(int index, double value) throws IOException { int arrayIndex = (pointer.get() + index) % rows; values.set(column, arrayIndex, value); }
/** {@inheritDoc} */ public double getValue(int index) throws IOException { int arrayIndex = (pointer.get() + index) % rows; return values.get(arrayIndex); }
/** {@inheritDoc} */ public void setValue(int index, double value) throws IOException { int arrayIndex = (pointer.get() + index) % rows; values.set(arrayIndex, value); }
String dump() throws IOException { StringBuilder sb = new StringBuilder("== ARCHIVE ==\n"); sb.append("RRA:").append(consolFun.get()).append(":").append(xff.get()).append(":").append(steps.get()).append(":").append(rows.get()).append("\n"); sb.append("interval [").append(getStartTime()).append(", ").append(getEndTime()).append("]" + "\n"); for (int i = 0; i < robins.length; i++) { sb.append(states[i].dump()); sb.append(robins[i].dump()); } return sb.toString(); }
public String dump() throws IOException { StringBuilder buffer = new StringBuilder("Robin " + pointer.get() + "/" + rows + ": "); double[] values = getValues(); for (double value : values) { buffer.append(Util.formatDouble(value, true)).append(" "); } buffer.append("\n"); return buffer.toString(); }
public String dump() throws IOException { StringBuilder buffer = new StringBuilder("Robin " + pointer.get() + "/" + rows + ": "); double[] values = getValues(); for (double value : values) { buffer.append(Util.formatDouble(value, true)).append(" "); } buffer.append("\n"); return buffer.toString(); }
public void store(double newValue) throws IOException { int position = pointer.get(); values.set(column, position, newValue); pointer.set((position + 1) % rows); }
/** {@inheritDoc} */ public void store(double newValue) throws IOException { int position = pointer.get(); values.set(position, newValue); pointer.set((position + 1) % rows); }
public void store(double newValue) throws IOException { int position = pointer.get(); values.set(position, newValue); pointer.set((position + 1) % rows); }
/** * Returns current starting timestamp. This value is not constant. * * @return Timestamp corresponding to the first archive row * @throws java.io.IOException Thrown in case of I/O error. */ public long getStartTime() throws IOException { long endTime = getEndTime(); long arcStep = getArcStep(); long numRows = rows.get(); return endTime - (numRows - 1) * arcStep; }
/** * Returns archive time step in seconds. Archive step is equal to RRD step * multiplied with the number of archive steps. * * @return Archive time step in seconds * @throws java.io.IOException Thrown in case of I/O error. */ public long getArcStep() throws IOException { return parentDb.getHeader().getStep() * steps.get(); }
/** {@inheritDoc} */ public void store(double newValue) throws IOException { int position = pointer.get(); values.set(column, position, newValue); pointer.set((position + 1) % rows); }
/** * Returns current starting timestamp. This value is not constant. * * @return Timestamp corresponding to the first archive row * @throws IOException Thrown in case of I/O error. */ public long getStartTime() throws IOException { long endTime = getEndTime(); long arcStep = getArcStep(); long numRows = rows.get(); return endTime - (numRows - 1) * arcStep; }