Package co.cask.cdap.metrics.data

Examples of co.cask.cdap.metrics.data.AggregatesTable.scan()


    // process.events.processed will have a tag like "input.queue://PurchaseFlow/reader/queue" which indicates
    // where the processed event came from.  So first get the aggregate count for events processed and all the
    // queues they came from. Next, for all those queues, get the aggregate count for events they wrote,
    // and subtract the two to get queue length.
    AggregatesScanner scanner = aggregatesTable.scan(metricsRequest.getContextPrefix(),
                                                     "process.events.processed",
                                                     metricsRequest.getRunId(),
                                                     "input");

    long processed = 0;
View Full Code Here


    // For each queue, get the enqueue aggregate
    long enqueue = 0;
    for (ImmutablePair<String, String> pair : queueNameContexts) {
      // The paths would be /flowId/flowletId/queueSimpleName
      enqueue += sumAll(aggregatesTable.scan(pair.getSecond(), "process.events.out", "0", pair.getFirst()));
    }
    for (String streamName : streamNames) {
      enqueue += sumAll(aggregatesTable.scan(Constants.Gateway.METRICS_CONTEXT, "collect.events", "0", streamName));
    }
View Full Code Here

    for (ImmutablePair<String, String> pair : queueNameContexts) {
      // The paths would be /flowId/flowletId/queueSimpleName
      enqueue += sumAll(aggregatesTable.scan(pair.getSecond(), "process.events.out", "0", pair.getFirst()));
    }
    for (String streamName : streamNames) {
      enqueue += sumAll(aggregatesTable.scan(Constants.Gateway.METRICS_CONTEXT, "collect.events", "0", streamName));
    }

    long len = enqueue - processed;
    return new AggregateResponse(len >= 0 ? len : 0);
  }
View Full Code Here

    return new TimeValueAggregator(timeValues.values(), interpolator).iterator();
  }

  private AggregateResponse getAggregates(MetricsRequest request) {
    AggregatesTable aggregatesTable = aggregatesTables.get().get(request.getScope());
    AggregatesScanner scanner = aggregatesTable.scan(request.getContextPrefix(), request.getMetricPrefix(),
                                                     request.getRunId(), request.getTagPrefix());
    return new AggregateResponse(sumAll(scanner));
  }

  private long sumAll(AggregatesScanner scanner) {
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.