Search in sources :

Example 1 with MovingAverageLong

use of com.datatorrent.stram.util.MovingAverage.MovingAverageLong in project apex-core by apache.

the class StreamingContainerManager method updateRPCLatency.

public void updateRPCLatency(String containerId, long latency) {
    if (vars.rpcLatencyCompensationSamples > 0) {
        MovingAverageLong latencyMA = rpcLatencies.get(containerId);
        if (latencyMA == null) {
            final MovingAverageLong val = new MovingAverageLong(vars.rpcLatencyCompensationSamples);
            latencyMA = rpcLatencies.putIfAbsent(containerId, val);
            if (latencyMA == null) {
                latencyMA = val;
            }
        }
        latencyMA.add(latency);
    }
}
Also used : MovingAverageLong(com.datatorrent.stram.util.MovingAverage.MovingAverageLong)

Aggregations

MovingAverageLong (com.datatorrent.stram.util.MovingAverage.MovingAverageLong)1