public void writeIntervalCsvData(StatisticsSet intervalStatistics) {
		// add headers into the csv file.
		if (!headerAdded) {
			StringBuilder csvHeader = new StringBuilder();
			csvHeader.append("DateTime").append(cvsSeparator).append("vuser");

			// Get the key list from lastStatistic map, use this list to keep
			// the write order
			for (Entry<String, StatisticExpression> each : getExpressionEntrySet()) {
				if (!each.getKey().equals("Peak_TPS")) {
					csvHeader.append(cvsSeparator).append(each.getKey());
				}
			}
			if (intervalStatisticMapPerTest.size() != 1) {
				for (int i = 1; i <= intervalStatisticMapPerTest.size(); i++) {
					csvHeader.append(cvsSeparator).append("Description");
					// get the key list from lastStatistic map, use list to keep
					// the order
					for (Entry<String, StatisticExpression> each : getExpressionEntrySet()) {
						if (!each.getKey().equals("Peak_TPS")) {
							csvHeader.append(cvsSeparator).append(each.getKey()).append("-").append(i);
						}
					}

				}
			}
			writeCSVDataLine(csvHeader.toString());
			headerAdded = true;
		}

		StringBuilder csvLine = new StringBuilder();
		csvLine.append(DateUtils.dateToString(new Date())).append(cvsSeparator).append(runningThread);
		for (Entry<String, StatisticExpression> each : getExpressionEntrySet()) {
			if (!each.getKey().equals("Peak_TPS")) {
				double doubleValue = each.getValue().getDoubleValue(intervalStatistics);
				csvLine.append(cvsSeparator).append(formatValue(getRealDoubleValue(doubleValue)));
			}
		}

		if (intervalStatisticMapPerTest.size() != 1) {
			for (Entry<Test, StatisticsSet> eachPair : intervalStatisticMapPerTest.entrySet()) {
				String description = eachPair.getKey().getDescription();
				csvLine.append(cvsSeparator).append(description);
				for (Entry<String, StatisticExpression> each : getExpressionEntrySet()) {
					if (!each.getKey().equals("Peak_TPS")) {
						csvLine.append(cvsSeparator).append(
								formatValue(getRealDoubleValue(each.getValue().getDoubleValue(eachPair.getValue()))));
					}
				}
			}
		}

		writeCSVDataLine(csvLine.toString());
	}
Write the each interval statistic data as the form of CSV.

@param intervalStatistics interval statistics
ngrinder-core/src/main/java/net/grinder/SingleConsole.java