public TaskErrorCollector(Configuration conf) {
errorCountsQueue = new LinkedList<Map<TaskError, Integer>>();
startTimeQueue = new LinkedList<Long>();
errorCountsMetrics = new HashMap<TaskError, MetricsTimeVaryingLong>();
MetricsContext context = MetricsUtil.getContext("mapred");
metricsRecord = MetricsUtil.createRecord(context, "taskerror");
registry = new MetricsRegistry();
windowLength = conf.getInt(WINDOW_LENGTH_KEY, WINDOW_LENGTH);
numWindows = conf.getInt(NUM_WINDOWS_KEY, NUM_WINDOWS);
context.registerUpdater(this);
String configFilePath = conf.get(CONFIG_FILE_KEY);
if (configFilePath == null) {
// Search the class path if it is not configured
URL u = TaskErrorCollector.class.getClassLoader().getResource(ERROR_XML);