public final void sample(){
synchronized (_lock) {
    long count=_totalCount.get();
    long lastCount=_lastAvgTotalCount;
    _lastAvgTotalCount=count;
    long sum=_sum.get();
    double lastSum=_lastAvgSum;
    _lastAvgSum=sum;
    if (count == lastCount) {
      _avg=0;
    }
 else {
      _avg=_scale * (sum - lastSum) / (double)(count - lastCount);
    }
  }
}

public final void sample ( ) { synchronized ( _lock ) { long count = _totalCount . get ( ) ; long lastCount = _lastAvgTotalCount ; _lastAvgTotalCount = count ; long sum = _sum . get ( ) ; double lastSum = _lastAvgSum ; _lastAvgSum = sum ; if ( count == lastCount ) { _avg = 0 ; } else { _avg = _scale * ( sum - lastSum ) / ( double ) ( count - lastCount ) ; } } }
return the probe ' s next average .
