Search in sources :

Example 1 with OperatorAggregationInfo

use of com.datatorrent.stram.webapp.OperatorAggregationInfo in project apex-core by apache.

the class StreamingContainerManager method fillOperatorAggregationInfo.

private OperatorAggregationInfo fillOperatorAggregationInfo(OperatorMeta operator) {
    OperatorAggregationInfo oai = new OperatorAggregationInfo();
    Collection<PTOperator> physicalOperators = getPhysicalPlan().getAllOperators(operator);
    if (physicalOperators.isEmpty()) {
        return null;
    }
    oai.name = operator.getName();
    for (PTOperator physicalOperator : physicalOperators) {
        if (!physicalOperator.isUnifier()) {
            OperatorStatus os = physicalOperator.stats;
            oai.latencyMA.addNumber(os.latencyMA.getAvg());
            oai.cpuPercentageMA.addNumber(os.cpuNanosPMSMA.getAvg() / 10000);
            oai.tuplesEmittedPSMA.addNumber(os.tuplesEmittedPSMA.get());
            oai.tuplesProcessedPSMA.addNumber(os.tuplesProcessedPSMA.get());
            oai.currentWindowId.addNumber(os.currentWindowId.get());
            oai.recoveryWindowId.addNumber(toWsWindowId(physicalOperator.getRecoveryCheckpoint().windowId));
            if (os.lastHeartbeat != null) {
                oai.lastHeartbeat.addNumber(os.lastHeartbeat.getGeneratedTms());
            }
            oai.checkpointTime.addNumber(os.checkpointTimeMA.getAvg());
        }
    }
    return oai;
}
Also used : PTOperator(com.datatorrent.stram.plan.physical.PTOperator) OperatorStatus(com.datatorrent.stram.plan.physical.OperatorStatus) LogicalOperatorStatus(com.datatorrent.stram.plan.logical.LogicalOperatorStatus) OperatorAggregationInfo(com.datatorrent.stram.webapp.OperatorAggregationInfo)

Aggregations

LogicalOperatorStatus (com.datatorrent.stram.plan.logical.LogicalOperatorStatus)1 OperatorStatus (com.datatorrent.stram.plan.physical.OperatorStatus)1 PTOperator (com.datatorrent.stram.plan.physical.PTOperator)1 OperatorAggregationInfo (com.datatorrent.stram.webapp.OperatorAggregationInfo)1