Search in sources :

Example 1 with StageStats

use of com.facebook.presto.client.StageStats in project presto by prestodb.

the class StatusPrinter method printStageTree.

private void printStageTree(StageStats stage, String indent, AtomicInteger stageNumberCounter) {
    Duration elapsedTime = nanosSince(start);
    // STAGE  S    ROWS  ROWS/s  BYTES  BYTES/s  QUEUED    RUN   DONE
    // 0......Q     26M   9077M  9993G    9077M   9077M  9077M  9077M
    //   2....R     17K    627M   673M     627M    627M   627M   627M
    //     3..C     999    627M   673M     627M    627M   627M   627M
    //   4....R     26M    627M   673T     627M    627M   627M   627M
    //     5..F     29T    627M   673M     627M    627M   627M   627M
    String id = String.valueOf(stageNumberCounter.getAndIncrement());
    String name = indent + id;
    name += Strings.repeat(".", max(0, 10 - name.length()));
    String bytesPerSecond;
    String rowsPerSecond;
    if (stage.isDone()) {
        bytesPerSecond = formatDataRate(new DataSize(0, BYTE), new Duration(0, SECONDS), false);
        rowsPerSecond = formatCountRate(0, new Duration(0, SECONDS), false);
    } else {
        bytesPerSecond = formatDataRate(bytes(stage.getProcessedBytes()), elapsedTime, false);
        rowsPerSecond = formatCountRate(stage.getProcessedRows(), elapsedTime, false);
    }
    String stageSummary = String.format("%10s%1s  %5s  %6s  %5s  %7s  %6s  %5s  %5s", name, stageStateCharacter(stage.getState()), formatCount(stage.getProcessedRows()), rowsPerSecond, formatDataSize(bytes(stage.getProcessedBytes()), false), bytesPerSecond, stage.getQueuedSplits(), stage.getRunningSplits(), stage.getCompletedSplits());
    reprintLine(stageSummary);
    for (StageStats subStage : stage.getSubStages()) {
        printStageTree(subStage, indent + "  ", stageNumberCounter);
    }
}
Also used : StageStats(com.facebook.presto.client.StageStats) FormatUtils.formatDataSize(com.facebook.presto.cli.FormatUtils.formatDataSize) DataSize(io.airlift.units.DataSize) Duration(io.airlift.units.Duration)

Aggregations

FormatUtils.formatDataSize (com.facebook.presto.cli.FormatUtils.formatDataSize)1 StageStats (com.facebook.presto.client.StageStats)1 DataSize (io.airlift.units.DataSize)1 Duration (io.airlift.units.Duration)1