Package org.jrobin.data

Examples of org.jrobin.data.DataProcessor


      comment.resolveText(dproc, valueScaler);
    }
  }

  private void fetchData() throws RrdException, IOException {
    dproc = new DataProcessor(gdef.startTime, gdef.endTime);
    dproc.setPoolUsed(gdef.poolUsed);
    if (gdef.step > 0) {
      dproc.setStep(gdef.step);
    }
    for (Source src : gdef.sources) {
View Full Code Here


  Object execute() throws RrdException, IOException {
    String startStr = getOptionValue("s", "start", DEFAULT_START);
    String endStr = getOptionValue("e", "end", DEFAULT_END);
    long span[] = Util.getTimestamps(startStr, endStr);
    dproc = new DataProcessor(span[0], span[1]);
    xports = new ArrayList<XPort>();
    long step = parseLong(getOptionValue(null, "step", "1"));
    int maxRows = parseInt(getOptionValue("m", "maxrows", "400"));
    long minStep = (long) Math.ceil((span[1] - span[0]) / (double) (maxRows - 1));
    step = Math.max(step, minStep);
View Full Code Here

   * @param rpnExpression RRDTool-like RPN expression
   * @return Calculated values
   * @throws RrdException Thrown if invalid RPN expression is supplied
   */
  public double[] getRpnValues(String rpnExpression) throws RrdException {
    DataProcessor dataProcessor = createDataProcessor(rpnExpression);
    return dataProcessor.getValues(RPN_SOURCE_NAME);
  }
View Full Code Here

   * @return MIN, MAX, LAST, FIRST, AVERAGE or TOTAL value calculated from the fetched data
   *         for the given datasource name
   * @throws RrdException Thrown if the given datasource name cannot be found in fetched data.
   */
  public double getAggregate(String dsName, String consolFun) throws RrdException {
    DataProcessor dp = createDataProcessor(null);
    return dp.getAggregate(dsName, consolFun);
  }
View Full Code Here

   * @param consolFun   Consolidation function (MIN, MAX, LAST, FIRST, AVERAGE or TOTAL)
   * @return Aggregated value
   * @throws RrdException Thrown if invalid RPN expression is supplied
   */
  public double getRpnAggregate(String rpnExpression, String consolFun) throws RrdException {
    DataProcessor dataProcessor = createDataProcessor(rpnExpression);
    return dataProcessor.getAggregate(RPN_SOURCE_NAME, consolFun);
  }
View Full Code Here

   * @param dsName Datasource name.
   * @return Simple object containing all aggregated values.
   * @throws RrdException Thrown if the given datasource name cannot be found in the fetched data.
   */
  public Aggregates getAggregates(String dsName) throws RrdException {
    DataProcessor dataProcessor = createDataProcessor(null);
    return dataProcessor.getAggregates(dsName);
  }
View Full Code Here

   * @param rpnExpression RRDTool-like RPN expression
   * @return Object containing all aggregated values
   * @throws RrdException Thrown if invalid RPN expression is supplied
   */
  public Aggregates getRpnAggregates(String rpnExpression) throws RrdException, IOException {
    DataProcessor dataProcessor = createDataProcessor(rpnExpression);
    return dataProcessor.getAggregates(RPN_SOURCE_NAME);
  }
View Full Code Here

   * @param dsName Datasource name
   * @return 95th percentile of fetched source values
   * @throws RrdException Thrown if invalid source name is supplied
   */
  public double get95Percentile(String dsName) throws RrdException {
    DataProcessor dataProcessor = createDataProcessor(null);
    return dataProcessor.get95Percentile(dsName);
  }
View Full Code Here

   * @param rpnExpression RRDTool-like RPN expression
   * @return 95-percentile
   * @throws RrdException Thrown if invalid RPN expression is supplied
   */
  public double getRpn95Percentile(String rpnExpression) throws RrdException {
    DataProcessor dataProcessor = createDataProcessor(rpnExpression);
    return dataProcessor.get95Percentile(RPN_SOURCE_NAME);
  }
View Full Code Here

  public long getArcEndTime() {
    return arcEndTime;
  }

  private DataProcessor createDataProcessor(String rpnExpression) throws RrdException {
    DataProcessor dataProcessor = new DataProcessor(request.getFetchStart(), request.getFetchEnd());
    for (String dsName : dsNames) {
      dataProcessor.addDatasource(dsName, this);
    }
    if (rpnExpression != null) {
      dataProcessor.addDatasource(RPN_SOURCE_NAME, rpnExpression);
      try {
        dataProcessor.processData();
      }
      catch (IOException ioe) {
        // highly unlikely, since all datasources have already calculated values
        throw new RuntimeException("Impossible error: " + ioe);
      }
View Full Code Here

TOP

Related Classes of org.jrobin.data.DataProcessor

Copyright © 2018 www.massapicom. 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.