/** * Returns string that represents all specified RRD creation parameters. Returned string * has the syntax of RRDTool's <code>create</code> command. * * @return Dumped content of <code>RrdDb</code> object. */ public String dump() { StringBuilder sb = new StringBuilder("create \""); sb.append(uri) .append("\"") .append(" --version ").append(getVersion()) .append(" --start ").append(getStartTime()) .append(" --step ").append(getStep()).append(" "); for (DsDef dsDef : dsDefs) { sb.append(dsDef.dump()).append(" "); } for (ArcDef arcDef : arcDefs) { sb.append(arcDef.dump()).append(" "); } return sb.toString().trim(); }
/** * Returns string that represents all specified RRD creation parameters. Returned string * has the syntax of RRDTool's <code>create</code> command. * * @return Dumped content of <code>RrdDb</code> object. */ public String dump() { StringBuilder sb = new StringBuilder("create \""); sb.append(path).append("\""); sb.append(" --version ").append(getVersion()); sb.append(" --start ").append(getStartTime()); sb.append(" --step ").append(getStep()).append(" "); for (DsDef dsDef : dsDefs) { sb.append(dsDef.dump()).append(" "); } for (ArcDef arcDef : arcDefs) { sb.append(arcDef.dump()).append(" "); } return sb.toString().trim(); }
Header(RrdDb parentDb, RrdDef rrdDef) throws IOException { this.parentDb = parentDb; String initSignature = null; if(rrdDef != null) { version = rrdDef.getVersion(); initSignature = SIGNATURE + ", " + VERSIONS[version - 1]; } else { initSignature = DEFAULT_SIGNATURE; } signature = new RrdString<>(this); // NOT constant, may be cached step = new RrdLong<>(this, true); // constant, may be cached dsCount = new RrdInt<>(this, true); // constant, may be cached arcCount = new RrdInt<>(this, true); // constant, may be cached lastUpdateTime = new RrdLong<>(this); if (rrdDef != null) { signature.set(initSignature); step.set(rrdDef.getStep()); dsCount.set(rrdDef.getDsCount()); arcCount.set(rrdDef.getArcCount()); lastUpdateTime.set(rrdDef.getStartTime()); } }
Header(RrdDb parentDb, RrdDef rrdDef) throws IOException { this.parentDb = parentDb; String initSignature = null; if(rrdDef != null) { version = rrdDef.getVersion(); initSignature = SIGNATURE + ", " + VERSIONS[ version - 1]; } else { initSignature = DEFAULT_SIGNATURE; } signature = new RrdString(this); // NOT constant, may be cached step = new RrdLong(this, true); // constant, may be cached dsCount = new RrdInt(this, true); // constant, may be cached arcCount = new RrdInt(this, true); // constant, may be cached lastUpdateTime = new RrdLong(this); if (rrdDef != null) { signature.set(initSignature); step.set(rrdDef.getStep()); dsCount.set(rrdDef.getDsCount()); arcCount.set(rrdDef.getArcCount()); lastUpdateTime.set(rrdDef.getStartTime()); } }