/** * Returns datasource name. * * @return Datasource name * @throws java.io.IOException Thrown in case of I/O error */ public String getName() throws IOException { return dsName.get(); }
/** * Returns RRD signature. Initially, the returned string will be * of the form <b><i>Rrd4j, version x.x</i></b>. * * @return RRD signature * @throws java.io.IOException Thrown in case of I/O error */ public String getSignature() throws IOException { return signature.get(); }
/** * Returns RRD signature. Initially, the returned string will be * of the form <b><i>Rrd4j, version x.x</i></b>. * * @return RRD signature * @throws IOException Thrown in case of I/O error */ public String getSignature() throws IOException { return signature.get(); }
/** * Returns datasource name. * * @return Datasource name * @throws IOException Thrown in case of I/O error */ public String getName() throws IOException { return dsName.get(); }
/** * Returns datasource type (GAUGE, COUNTER, DERIVE, ABSOLUTE). * * @return Datasource type. * @throws IOException Thrown in case of I/O error */ public DsType getType() throws IOException { return DsType.valueOf(dsType.get()); }
/** * Returns archive consolidation function ("AVERAGE", "MIN", "MAX" or "LAST"). * * @return Archive consolidation function. * @throws IOException Thrown in case of I/O error. */ public ConsolFun getConsolFun() throws IOException { return ConsolFun.valueOf(consolFun.get()); }
/** * Returns index of this Datasource object in the RRD. * * @return Datasource index in the RRD. * @throws IOException Thrown in case of I/O error */ public int getDsIndex() throws IOException { try { return parentDb.getDsIndex(dsName.get()); } catch (IllegalArgumentException e) { return -1; } }
/** * Returns index of this Datasource object in the RRD. * * @return Datasource index in the RRD. * @throws java.io.IOException Thrown in case of I/O error */ public int getDsIndex() throws IOException { try { return parentDb.getDsIndex(dsName.get()); } catch (IllegalArgumentException e) { return -1; } }
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(); }
private double calculateLastTotal(long startTime, long boundaryTime) throws IOException { double totalValue = Double.NaN; long validSeconds = boundaryTime - startTime - nanSeconds.get(); if (nanSeconds.get() <= heartbeat.get() && validSeconds > 0) { totalValue = accumLastValue; } if (Double.isNaN(totalValue) && dsName.get().endsWith(DsDef.FORCE_ZEROS_FOR_NANS_SUFFIX)) { totalValue = 0D; } return totalValue; }
private double calculateTotal(long startTime, long boundaryTime) throws IOException { double totalValue = Double.NaN; long validSeconds = boundaryTime - startTime - nanSeconds.get(); if (nanSeconds.get() <= heartbeat.get() && validSeconds > 0) { totalValue = accumValue.get() / validSeconds; } // IMPORTANT: // if datasource name ends with "!", we'll send zeros instead of NaNs // this might be handy from time to time if (Double.isNaN(totalValue) && dsName.get().endsWith(DsDef.FORCE_ZEROS_FOR_NANS_SUFFIX)) { totalValue = 0D; } return totalValue; }
String dump() throws IOException { return "== DATASOURCE ==\n" + "DS:" + dsName.get() + ":" + dsType.name() + ":" + heartbeat.get() + ":" + minValue.get() + ":" + maxValue.get() + "\nlastValue:" + lastValue.get() + " nanSeconds:" + nanSeconds.get() + " accumValue:" + accumValue.get() + "\n"; }
public void setDsType(DsType newDsType) throws IOException { // set datasource type this.dsType.set(newDsType.name()); // reset datasource status lastValue.set(Double.NaN); accumValue.set(0.0); // reset archive status int dsIndex = parentDb.getDsIndex(dsName.get()); Archive[] archives = parentDb.getArchives(); for (Archive archive : archives) { archive.getArcState(dsIndex).setAccumValue(Double.NaN); } }
void appendXml(XmlWriter writer) throws IOException { writer.startTag("ds"); writer.writeTag("name", dsName.get()); writer.writeTag("type", dsType.get()); writer.writeTag("minimal_heartbeat", heartbeat.get()); writer.writeTag("min", minValue.get()); writer.writeTag("max", maxValue.get()); writer.writeComment("PDP Status"); writer.writeTag("last_ds", lastValue.get(), "UNKN"); writer.writeTag("value", accumValue.get()); writer.writeTag("unknown_sec", nanSeconds.get()); writer.closeTag(); // ds }
void appendXml(XmlWriter writer) throws IOException { writer.writeComment(signature.get()); writer.writeTag("version", RRDTOOL_VERSION3); writer.writeComment("Seconds"); writer.writeTag("step", step.get()); writer.writeComment(Util.getDate(lastUpdateTime.get())); writer.writeTag("lastupdate", lastUpdateTime.get()); }
void appendXml(XmlWriter writer) throws IOException { writer.writeComment(signature.get()); writer.writeTag("version", RRDTOOL_VERSION); writer.writeComment("Seconds"); writer.writeTag("step", step.get()); writer.writeComment(Util.getDate(lastUpdateTime.get())); writer.writeTag("lastupdate", lastUpdateTime.get()); }
void appendXml(XmlWriter writer) throws IOException { writer.startTag("ds"); writer.writeTag("name", dsName.get()); writer.writeTag("type", dsType.name()); writer.writeTag("minimal_heartbeat", heartbeat.get()); writer.writeTag("min", minValue.get()); writer.writeTag("max", maxValue.get()); writer.writeComment("PDP Status"); writer.writeTag("last_ds", lastValue.get(), "UNKN"); writer.writeTag("value", accumValue.get()); writer.writeTag("unknown_sec", nanSeconds.get()); writer.closeTag(); // ds }