/** * Returns Archive object with the given consolidation function and the number * of steps. * * @param consolFun Consolidation function * @param steps Number of archive steps * @return Requested Archive object or null if no such archive could be found * @throws IOException Thrown in case of I/O error */ public Archive getArchive(ConsolFun consolFun, int steps) throws IOException { try { return getArchive(getArcIndex(consolFun, steps)); } catch (IllegalArgumentException e) { return null; } }
/** * Returns Archive object with the given consolidation function and the number * of steps. * * @param consolFun Consolidation function * @param steps Number of archive steps * @return Requested Archive object or null if no such archive could be found * @throws java.io.IOException Thrown in case of I/O error */ public Archive getArchive(ConsolFun consolFun, int steps) throws IOException { try { return getArchive(getArcIndex(consolFun, steps)); } catch (IllegalArgumentException e) { return null; } }
static int getMatchingArchiveIndex(RrdDb rrd1, int arcIndex, RrdDb rrd2) throws IOException { Archive archive = rrd1.getArchive(arcIndex); ConsolFun consolFun = archive.getConsolFun(); int steps = archive.getSteps(); try { return rrd2.getArcIndex(consolFun, steps); } catch (IllegalArgumentException e) { return -1; } }
static int getMatchingArchiveIndex(RrdDb rrd1, int arcIndex, RrdDb rrd2) throws IOException { Archive archive = rrd1.getArchive(arcIndex); ConsolFun consolFun = archive.getConsolFun(); int steps = archive.getSteps(); try { return rrd2.getArcIndex(consolFun, steps); } catch (IllegalArgumentException e) { return -1; } }
/** * Sets single archive's X-files factor to a new value. * * @param sourcePath Path to existing RRD file (will be updated) * @param consolFun Consolidation function of the target archive * @param steps Number of sptes of the target archive * @param newXff New X-files factor for the target archive * @throws IOException Thrown in case of I/O error */ public static void setArcXff(String sourcePath, ConsolFun consolFun, int steps, double newXff) throws IOException { RrdDb rrd = new RrdDb(sourcePath); try { Archive arc = rrd.getArchive(consolFun, steps); arc.setXff(newXff); } finally { rrd.close(); } }
/** * Sets single archive's X-files factor to a new value. * * @param sourcePath Path to existing RRD file (will be updated) * @param consolFun Consolidation function of the target archive * @param steps Number of steps of the target archive * @param newXff New X-files factor for the target archive * @throws java.io.IOException Thrown in case of I/O error */ public static void setArcXff(String sourcePath, ConsolFun consolFun, int steps, double newXff) throws IOException { try (RrdDb rrd = RrdDb.getBuilder().setPath(sourcePath).build()) { Archive arc = rrd.getArchive(consolFun, steps); arc.setXff(newXff); } }
public void setValueAt(Object aValue, int rowIndex, int columnIndex) { assert columnIndex == 2 : "Column " + columnIndex + " is not editable!"; double value; try { value = Double.parseDouble(aValue.toString()); } catch (NumberFormatException nfe) { value = Double.NaN; } if (dsIndex >= 0 && arcIndex >= 0 && file != null) { try { RrdDb rrd = new RrdDb(file.getAbsolutePath()); try { Robin robin = rrd.getArchive(arcIndex).getRobin(dsIndex); robin.setValue(rowIndex, value); values[rowIndex][2] = InspectorModel.formatDouble(robin.getValue(rowIndex)); } finally { rrd.close(); } } catch (Exception e) { Util.error(null, e); } } }
RrdDb rrd = new RrdDb(file.getAbsolutePath(), true); try { Archive arc = rrd.getArchive(arcIndex); Robin robin = arc.getRobin(dsIndex); long start = arc.getStartTime();
RrdDb rrd = new RrdDb(file.getAbsolutePath(), true); try { Archive arc = rrd.getArchive(arcIndex); ArcState state = arc.getArcState(dsIndex); values = new Object[]{
Archive srcArchive = rrdSource.getArchive(i); ConsolFun consolFun = srcArchive.getConsolFun(); int steps = srcArchive.getSteps(); Archive dstArchive = rrdDest.getArchive(consolFun, steps); if(dstArchive != null) { if(dstArchive.getConsolFun().equals(srcArchive.getConsolFun()) && dstArchive.getSteps() == srcArchive.getSteps()) {
try { Datasource ds = rrdDb.getDatasource(dsIndex); Archive arc = rrdDb.getArchive(arcIndex); Robin robin = arc.getRobin(dsIndex); dsName = ds.getName();