<commit_before>/*
 * Copyright 2012 <NAME>
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
 * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations under the License.
 */

package org.pmw.benchmark;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.text.MessageFormat;
import java.util.Arrays;

import org.pmw.benchmark.dummy.DummyBenchmark;

public abstract class AbstractRunner {

	private static final int BENCHMARK_ITERATIONS = 120; // Number of benchmark to run
	private static final int OUTLIERS_CUT = 10; // Number of best and worst results to exclude

	private static final String RESULT_MESSAGE = "{0}: {1} log entries in {2}ms = {3} log entries per second";
	private static final String ERROR_MESSAGE = "{0} lines has been written, but {1} lines expected";

	private final String name;
	private final IBenchmark benchmark;

	AbstractRunner(final String name, final IBenchmark benchmark) {
		this.name = name;
		this.benchmark = benchmark;
	}

	public final void start() throws Exception {
		File[] files = new File[BENCHMARK_ITERATIONS];
		for (int i = 0; i < BENCHMARK_ITERATIONS; ++i) {
			File file = File.createTempFile("log", ".txt");<commit_msg>Increased default number of benchmark iterations<commit_after>/*
 * Copyright 2012 <NAME>
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
 * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations under the License.
 */

package org.pmw.benchmark;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.text.MessageFormat;
import java.util.Arrays;

import org.pmw.benchmark.dummy.DummyBenchmark;

public abstract class AbstractRunner {

	private static final int BENCHMARK_ITERATIONS = 1; // Number of benchmark to run
	private static final int OUTLIERS_CUT = 0; // Number of best and worst results to exclude

	private static final String RESULT_MESSAGE = "{0}: {1} log entries in {2}ms = {3} log entries per second";
	private static final String ERROR_MESSAGE = "{0} lines has been written, but {1} lines expected";

	private final String name;
	private final IBenchmark benchmark;

	AbstractRunner(final String name, final IBenchmark benchmark) {
		this.name = name;
		this.benchmark = benchmark;
	}

	public final void start() throws Exception {
		File[] files = new File[BENCHMARK_ITERATIONS];
		for (int i = 0; i < BENCHMARK_ITERATIONS; ++i) {
			File file = File.createTempFile("log", ".txt");
{'fraction_non_alphanumeric': 0.0852099817407182, 'fraction_numerical': 0.01125989044430919, 'mean_word_length': 4.370915032679738, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3012866', 'n_tokens_mistral': 969, 'n_tokens_neox': 902, 'n_words': 392}