class ThreadDataLogger {

  public void report(int runNumber,
                     Test test,
                     long timeSinceExecutionStart,
                     StatisticsSet statistics) {

    if (runNumber == m_lastRunNumber && m_lastRunNumber != -1) {
      m_buffer.setLength(m_bufferAfterRunNumberIndex);
    }
    else {
      m_lastRunNumber = runNumber;

      m_buffer.setLength(m_bufferAfterThreadIDIndex);
      m_buffer.append(runNumber);
      m_buffer.append(SEPARATOR);
      m_bufferAfterRunNumberIndex = m_buffer.length();
    }

    m_buffer.append(test.getNumber());

    m_buffer.append(SEPARATOR);
    m_buffer.append(timeSinceExecutionStart);

    for (ExpressionView expressionView : m_expressionViews) {
      m_buffer.append(SEPARATOR);

      final StatisticExpression expression = expressionView.getExpression();

      if (expression.isDouble()) {
        m_buffer.append(expression.getDoubleValue(statistics));
      }
      else {
        m_buffer.append(expression.getLongValue(statistics));
      }
    }

    m_dataLog.info(m_buffer.toString(),
                   new DataLogArguments(m_threadNumber,
                                        runNumber,
                                        test,
                                        timeSinceExecutionStart,
                                        statistics));
  }

  public  ThreadDataLogger(Logger dataLog,
                          ExpressionView[] expressionViews,
                          int threadNumber);

}