protected void updateValues(){
synchronized (workers) {
    if (prev.length == curr.length) {
      System.arraycopy(curr,0,prev,0,prev.length);
      allThreadsData data=new allThreadsData();
      data.setIterations(curr);
      data=readValues(data);
      curr=data.getIterations();
      totalResponseTime=data.getTotalResponseTimes();
      responseTimeStdDev=data.getResponseTimeStdDev();
    }
 else {
      prev=curr;
      allThreadsData data=new allThreadsData();
      data.setIterations(curr);
      data=readValues((allThreadsData)null);
      curr=data.getIterations();
      totalResponseTime=data.getTotalResponseTimes();
      responseTimeStdDev=data.getResponseTimeStdDev();
    }
    prevMeasurementTime=currMeasurementTime;
    currMeasurementTime=System.currentTimeMillis();
  }
}

protected void updateValues ( ) { synchronized ( workers ) { if ( prev . length == curr . length ) { System . arraycopy ( curr , 0 , prev , 0 , prev . length ) ; allThreadsData data = new allThreadsData ( ) ; data . setIterations ( curr ) ; data = readValues ( data ) ; curr = data . getIterations ( ) ; totalResponseTime = data . getTotalResponseTimes ( ) ; responseTimeStdDev = data . getResponseTimeStdDev ( ) ; } else { prev = curr ; allThreadsData data = new allThreadsData ( ) ; data . setIterations ( curr ) ; data = readValues ( ( allThreadsData ) null ) ; curr = data . getIterations ( ) ; totalResponseTime = data . getTotalResponseTimes ( ) ; responseTimeStdDev = data . getResponseTimeStdDev ( ) ; } prevMeasurementTime = currMeasurementTime ; currMeasurementTime = System . currentTimeMillis ( ) ; } }
read the latest iteration counts from all available workerthreads , keeping a copy of the previous readings . this method ensures no iterations are lost " between the cracks " .
