Esempio n. 1
0
 public CounterStat getOutputPositions() {
   CounterStat stat = new CounterStat();
   stat.merge(outputPositions);
   for (DriverContext driver : drivers) {
     stat.merge(driver.getOutputPositions());
   }
   return stat;
 }
Esempio n. 2
0
 public CounterStat getOutputDataSize() {
   CounterStat stat = new CounterStat();
   stat.merge(outputDataSize);
   for (DriverContext driver : drivers) {
     stat.merge(driver.getOutputDataSize());
   }
   return stat;
 }
Esempio n. 3
0
 public CounterStat getOutputPositions() {
   CounterStat stat = new CounterStat();
   for (PipelineContext pipelineContext : pipelineContexts) {
     if (pipelineContext.isOutputPipeline()) {
       stat.merge(pipelineContext.getOutputPositions());
     }
   }
   return stat;
 }
Esempio n. 4
0
 public CounterStat getInputDataSize() {
   CounterStat stat = new CounterStat();
   for (PipelineContext pipelineContext : pipelineContexts) {
     if (pipelineContext.isInputPipeline()) {
       stat.merge(pipelineContext.getInputDataSize());
     }
   }
   return stat;
 }
Esempio n. 5
0
  public void driverFinished(DriverContext driverContext) {
    checkNotNull(driverContext, "driverContext is null");

    if (!drivers.remove(driverContext)) {
      throw new IllegalArgumentException("Unknown driver " + driverContext);
    }

    DriverStats driverStats = driverContext.getDriverStats();

    completedDrivers.getAndIncrement();

    // remove the memory reservation
    memoryReservation.getAndAdd(-driverStats.getMemoryReservation().toBytes());

    queuedTime.add(driverStats.getQueuedTime().roundTo(NANOSECONDS));
    elapsedTime.add(driverStats.getElapsedTime().roundTo(NANOSECONDS));

    totalScheduledTime.getAndAdd(driverStats.getTotalScheduledTime().roundTo(NANOSECONDS));
    totalCpuTime.getAndAdd(driverStats.getTotalCpuTime().roundTo(NANOSECONDS));
    totalUserTime.getAndAdd(driverStats.getTotalUserTime().roundTo(NANOSECONDS));

    totalBlockedTime.getAndAdd(driverStats.getTotalBlockedTime().roundTo(NANOSECONDS));

    // merge the operator stats into the operator summary
    List<OperatorStats> operators = driverStats.getOperatorStats();
    for (OperatorStats operator : operators) {
      // TODO: replace with ConcurrentMap.compute() when we migrate to java 8
      OperatorStats updated;
      OperatorStats current;
      do {
        current = operatorSummaries.get(operator.getOperatorId());
        if (current != null) {
          updated = current.add(operator);
        } else {
          updated = operator;
        }
      } while (!compareAndSet(operatorSummaries, operator.getOperatorId(), current, updated));
    }

    rawInputDataSize.update(driverStats.getRawInputDataSize().toBytes());
    rawInputPositions.update(driverStats.getRawInputPositions());

    processedInputDataSize.update(driverStats.getProcessedInputDataSize().toBytes());
    processedInputPositions.update(driverStats.getProcessedInputPositions());

    outputDataSize.update(driverStats.getOutputDataSize().toBytes());
    outputPositions.update(driverStats.getOutputPositions());
  }
Esempio n. 6
0
 public void addCompletedDataSize(DataSize addedDataSize) {
   completedBytes.update(addedDataSize.toBytes());
 }
Esempio n. 7
0
 public void addCompletedPositions(long positions) {
   completedPositions.update(positions);
 }
Esempio n. 8
0
 public void addSplitWallTime(Duration duration) {
   splitWallTime.update(duration.toMillis());
 }
Esempio n. 9
0
 public void splitCompleted() {
   completedSplits.update(1);
 }
Esempio n. 10
0
 public void splitStarted() {
   startedSplits.update(1);
 }
Esempio n. 11
0
 public void addSplits(int count) {
   scheduledSplits.update(count);
 }
Esempio n. 12
0
 @Managed
 public long getRunningSplits() {
   return Math.max(0, startedSplits.getTotalCount() - completedSplits.getTotalCount());
 }