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);
}
}
Aggregations