Examples of RrdDb


Examples of org.jrobin.core.RrdDb

    int rows = parseInt(tokens[4]);
    rrdDef.addArchive(cf, xff, steps, rows);
  }

  private String createRrdDb() throws IOException, RrdException {
    RrdDb rrdDb = getRrdDbReference(rrdDef);
    releaseRrdDbReference(rrdDb);
    return rrdDef.getPath();
  }
View Full Code Here

Examples of org.jrobin.core.RrdDb

    if (words.length != 3) {
      throw new RrdException("Invalid rrdrestore syntax");
    }
    String xmlPath = words[1];
    String rrdPath = words[2];
    RrdDb rrdDb = getRrdDbReference(rrdPath, xmlPath);
    try {
      if (check) {
        int dsCount = rrdDb.getHeader().getDsCount();
        for (int i = 0; i < dsCount; i++) {
          Datasource ds = rrdDb.getDatasource(i);
          double minValue = ds.getMinValue();
          double maxValue = ds.getMaxValue();
          // this will perform range check
          ds.setMinMaxValue(minValue, maxValue, true);
        }
View Full Code Here

Examples of org.jrobin.core.RrdDb

    super(INVALID_NODE);
  }

  boolean setFile(File file) {
    try {
      RrdDb rrd = new RrdDb(file.getAbsolutePath(), true);
      try {
        DefaultMutableTreeNode root = new DefaultMutableTreeNode(new RrdNode(rrd));
        int dsCount = rrd.getRrdDef().getDsCount();
        int arcCount = rrd.getRrdDef().getArcCount();
        for (int dsIndex = 0; dsIndex < dsCount; dsIndex++) {
          DefaultMutableTreeNode dsNode =
              new DefaultMutableTreeNode(new RrdNode(rrd, dsIndex));
          for (int arcIndex = 0; arcIndex < arcCount; arcIndex++) {
            DefaultMutableTreeNode arcNode =
                new DefaultMutableTreeNode(new RrdNode(rrd, dsIndex, arcIndex));
            dsNode.add(arcNode);
          }
          root.add(dsNode);
        }
        setRoot(root);
      }
      finally {
        rrd.close();
      }
      return true;
    }
    catch (IOException e) {
      setRoot(INVALID_NODE);
View Full Code Here

Examples of org.jrobin.core.RrdDb

    String[] words = getRemainingWords();
    if (words.length != 2) {
      throw new RrdException("Invalid rrdinfo syntax");
    }
    String path = words[1], info;
    RrdDb rrd = getRrdDbReference(path);
    try {
      info = getInfo(rrd);
      println(info);
    }
    finally {
View Full Code Here

Examples of org.jrobin.core.RrdDb

    String[] words = getRemainingWords();
    if (words.length != 2) {
      throw new RrdException("Invalid rrddump syntax");
    }
    String path = words[1];
    RrdDb rrdDb = getRrdDbReference(path);
    try {
      String xml = rrdDb.getXml();
      println(xml);
      return xml;
    }
    finally {
      releaseRrdDbReference(rrdDb);
View Full Code Here

Examples of org.jrobin.core.RrdDb

  void setFile(File file) {
    try {
      values = null;
      String path = file.getAbsolutePath();
      RrdDb rrd = new RrdDb(path, true);
      try {
        Header header = rrd.getHeader();
        String signature = header.getSignature();
        String step = "" + header.getStep();
        String lastTimestamp = header.getLastUpdateTime() + " [" +
            new Date(header.getLastUpdateTime() * 1000L) + "]";
        String datasources = "" + header.getDsCount();
        String archives = "" + header.getArcCount();
        String size = rrd.getRrdBackend().getLength() + " bytes";
        values = new Object[] {
            path, signature, step, lastTimestamp, datasources, archives, size
        };
      }
      finally {
        rrd.close();
      }
      fireTableDataChanged();
    }
    catch (IOException e) {
      Util.error(null, e);
View Full Code Here

Examples of org.jrobin.core.RrdDb

  static RrdDb getRrdDbReference(String path) throws IOException, RrdException {
    if (rrdDbPoolUsed) {
      return RrdDbPool.getInstance().requestRrdDb(path);
    }
    else {
      return new RrdDb(path);
    }
  }
View Full Code Here

Examples of org.jrobin.core.RrdDb

  static RrdDb getRrdDbReference(String path, String xmlPath) throws IOException, RrdException,RrdException {
    if (rrdDbPoolUsed) {
      return RrdDbPool.getInstance().requestRrdDb(path, xmlPath);
    }
    else {
      return new RrdDb(path, xmlPath);
    }
  }
View Full Code Here

Examples of org.jrobin.core.RrdDb

  static RrdDb getRrdDbReference(RrdDef rrdDef) throws IOException, RrdException {
    if (rrdDbPoolUsed) {
      return RrdDbPool.getInstance().requestRrdDb(rrdDef);
    }
    else {
      return new RrdDb(rrdDef);
    }
  }
View Full Code Here

Examples of org.jrobin.core.RrdDb

    }
    if (words.length > 2) {
      throw new RrdException("Unexpected token encountered: " + words[2]);
    }
    String path = words[1];
    RrdDb rrd = getRrdDbReference(path);
    try {
      // heartbeat
      for (String heartbeat : heartbeats) {
        tuneHeartbeat(rrd, heartbeat);
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.