@JsonIgnore ArcDef getDef() { Objects.requireNonNull(consolFun, "The consolFun property is required"); Objects.requireNonNull(xff, "The xff property is required"); Objects.requireNonNull(steps, "The steps property is required"); Objects.requireNonNull(rows, "The rows property is required"); return new ArcDef(consolFun, xff, steps, rows); } }
/** * Adds single archive definition represented with object of class <code>ArcDef</code>. * * @param arcDef Archive definition. * @throws IllegalArgumentException Thrown if archive with the same consolidation function * and the same number of steps is already added. */ public void addArchive(ArcDef arcDef) { if (arcDefs.contains(arcDef)) { throw new IllegalArgumentException("Archive already defined: " + arcDef.dump()); } arcDefs.add(arcDef); }
consolFunCombo.setSelectedItem(arcDef.getConsolFun()); consolFunCombo.setEnabled(false); xffField.setText("" + arcDef.getXff()); stepsField.setText("" + arcDef.getSteps()); stepsField.setEnabled(false); rowsField.setText("" + arcDef.getRows());
ArcDef findArchive(ConsolFun consolFun, int steps) { for (ArcDef arcDef : arcDefs) { if (arcDef.getConsolFun() == consolFun && arcDef.getSteps() == steps) { return arcDef; } } throw new IllegalArgumentException("Could not find archive " + consolFun + "/" + steps); }
@Test public void testLoad() throws Exception { JrdsDocument d = Tools.parseRessource("goodarchives.xml"); ArchivesSetBuilder asb = new ArchivesSetBuilder(); ArchivesSet arcset = asb.build(d); ArcDef[] arcs = arcset.getArchives(); Assert.assertEquals("wrong name for archives set", "newarchives", arcset.getName()); Assert.assertEquals("not enough archives", 2, arcs.length); Assert.assertEquals("not enough archives", ConsolFun.AVERAGE, arcs[0].getConsolFun()); Assert.assertEquals("not enough archives", ConsolFun.MAX, arcs[1].getConsolFun()); }
/** * Returns the number of storage bytes required to create RRD from this * RrdDef object. * * @return Estimated byte count of the underlying RRD storage. */ public long getEstimatedSize() { int dsCount = dsDefs.size(); int arcCount = arcDefs.size(); int rowsCount = 0; for (ArcDef arcDef : arcDefs) { rowsCount += arcDef.getRows(); } return calculateSize(dsCount, arcCount, rowsCount); }
boolean matched = false; for (ArcDef anArcDefs2 : arcDefs2) { if (arcDef.exactlyEqual(anArcDefs2)) { matched = true; break;
ArcDef findArchive(ConsolFun consolFun, int steps) { for (ArcDef arcDef : arcDefs) { if (arcDef.getConsolFun() == consolFun && arcDef.getSteps() == steps) { return arcDef; } } throw new IllegalArgumentException("Could not find archive " + consolFun + "/" + steps); }
/** * Returns the number of storage bytes required to create RRD from this * RrdDef object. * * @return Estimated byte count of the underlying RRD storage. */ public long getEstimatedSize() { int dsCount = dsDefs.size(); int arcCount = arcDefs.size(); int rowsCount = 0; for (ArcDef arcDef : arcDefs) { rowsCount += arcDef.getRows(); } String[] dsNames = new String[dsCount]; for (int i = 0; i < dsNames.length ; i++) { dsNames[i] = dsDefs.get(i).getDsName(); } return calculateSize(dsCount, arcCount, rowsCount, dsNames); }
boolean matched = false; for (ArcDef anArcDefs2 : arcDefs2) { if (arcDef.exactlyEqual(anArcDefs2)) { matched = true; break;
RrdToolkit.setArcXff(sourcePath, newArcDef.getConsolFun(), newArcDef.getSteps(), newArcDef.getXff()); RrdToolkit.resizeArchive(sourcePath, newArcDef.getConsolFun(), newArcDef.getSteps(), newArcDef.getRows(), SHOULD_CREATE_BACKUPS); inspectorModel.refresh(); tabbedPane.setSelectedIndex(0);
/** * Adds single archive definition by specifying its consolidation function, X-files factor, * number of steps and rows. For the complete explanation of all archive * definition parameters see RRDTool's * <a href="../../../../man/rrdcreate.html" target="man">rrdcreate man page</a>. * * @param consolFun Consolidation function. * @param xff X-files factor. Valid values are between 0 and 1. * @param steps Number of archive steps * @param rows Number of archive rows * @throws java.lang.IllegalArgumentException Thrown if archive with the same consolidation function * and the same number of steps is already added. */ public void addArchive(ConsolFun consolFun, double xff, int steps, int rows) { addArchive(new ArcDef(consolFun, xff, steps, rows)); }
try { ArcDef arcDef = rrd.getRrdDef().getArcDefs()[arcIndex]; consolFun = arcDef.getConsolFun(); steps = arcDef.getSteps();
/** * Adds single archive definition represented with object of class <code>ArcDef</code>. * * @param arcDef Archive definition. * @throws java.lang.IllegalArgumentException Thrown if archive with the same consolidation function * and the same number of steps is already added. */ public void addArchive(ArcDef arcDef) { if (arcDefs.contains(arcDef)) { throw new IllegalArgumentException("Archive already defined: " + arcDef.dump()); } arcDefs.add(arcDef); }
boolean shouldInitialize = arcDef != null; if (shouldInitialize) { consolFun.set(arcDef.getConsolFun().name()); xff.set(arcDef.getXff()); steps.set(arcDef.getSteps()); rows.set(arcDef.getRows());
/** * Adds single archive definition by specifying its consolidation function, X-files factor, * number of steps and rows. For the complete explanation of all archive * definition parameters see RRDTool's * <a href="../../../../man/rrdcreate.html" target="man">rrdcreate man page</a>.</p> * * @param consolFun Consolidation function. * @param xff X-files factor. Valid values are between 0 and 1. * @param steps Number of archive steps * @param rows Number of archive rows * @throws IllegalArgumentException Thrown if archive with the same consolidation function * and the same number of steps is already added. */ public void addArchive(ConsolFun consolFun, double xff, int steps, int rows) { addArchive(new ArcDef(consolFun, xff, steps, rows)); }
public void addArchive(ArcDef arcDef) { add(arcDef); logger.trace(Util.delayedFormatString("Adding archive: %s", arcDef.dump())); }
boolean shouldInitialize = arcDef != null; if (shouldInitialize) { consolFun.set(arcDef.getConsolFun()); xff.set(arcDef.getXff()); steps.set(arcDef.getSteps()); rows.set(arcDef.getRows());