private void addPingTimeData(long sample){
  lastPingTimesLock.lock();
  try {
    if (lastPingTimes == null) {
      lastPingTimes=new long[PING_MOVING_AVERAGE_WINDOW];
      Arrays.fill(lastPingTimes,sample);
    }
 else {
      System.arraycopy(lastPingTimes,1,lastPingTimes,0,lastPingTimes.length - 1);
      lastPingTimes[lastPingTimes.length - 1]=sample;
    }
  }
  finally {
    lastPingTimesLock.unlock();
  }
}

private void addPingTimeData ( long sample ) { lastPingTimesLock . lock ( ) ; try { if ( lastPingTimes == null ) { lastPingTimes = new long [ PING_MOVING_AVERAGE_WINDOW ] ; Arrays . fill ( lastPingTimes , sample ) ; } else { System . arraycopy ( lastPingTimes , 1 , lastPingTimes , 0 , lastPingTimes . length - 1 ) ; lastPingTimes [ lastPingTimes . length - 1 ] = sample ; } } finally { lastPingTimesLock . unlock ( ) ; } }
adds a ping time sample to the averaging window .
