protected allThreadsData readValues(allThreadsData values){
synchronized (workers) {
    int count=workers.size();
    if (values == null) {
      values=new allThreadsData();
      values.setSize(count);
    }
 else     if (values.getSize() != count) {
      values.setSize(count);
    }
    int i=0;
    final Iterator<WorkerThread> iter=workers.iterator();
    while (iter.hasNext() && i < values.getSize()) {
      WorkerThread worker=(WorkerThread)iter.next();
      int index=i++;
      values.setIterationValue(index,worker.getIterations());
      values.setTotalResponseTimesValue(index,worker.resetTotalTime());
    }
  }
  return values;
}

protected allThreadsData readValues ( allThreadsData values ) { synchronized ( workers ) { int count = workers . size ( ) ; if ( values == null ) { values = new allThreadsData ( ) ; values . setSize ( count ) ; } else if ( values . getSize ( ) != count ) { values . setSize ( count ) ; } int i = 0 ; final Iterator < WorkerThread > iter = workers . iterator ( ) ; while ( iter . hasNext ( ) && i < values . getSize ( ) ) { WorkerThread worker = ( WorkerThread ) iter . next ( ) ; int index = i ++ ; values . setIterationValue ( index , worker . getIterations ( ) ) ; values . setTotalResponseTimesValue ( index , worker . resetTotalTime ( ) ) ; } } return values ; }
read the latest iteration counts from all available workerthreads .
