package com.blazemeter.jmeter.reporters;

import org.apache.jmeter.reporters.ResultCollector;

public class FlushingResultCollector extends ResultCollector {
    public FlushingResultCollector() {
        super();
        getSaveConfig().setFieldNames(true);
    }

    @Override
    public void testEnded(String host) {
        super.testEnded(host);
        flushFile();
    }
}

@@ -91,286 +91,688 @@
 or;%0A
-%0Apublic class FlushingResultCollector extends ResultCollector %7B%0A    public FlushingResultCollector() %7B%0A        super();%0A        getSaveConfig().setFieldNames(true);%0A    %7D%0A%0A    @Override%0A    public void testEnded(String host) %7B%0A        super.testEnded(host);%0A        flushFile();
+import org.apache.jorphan.logging.LoggingManager;%0Aimport org.apache.log.Logger;%0A%0Apublic class FlushingResultCollector extends ResultCollector %7B%0A    private static final Logger log = LoggingManager.getLoggerForClass();%0A%0A    public FlushingResultCollector() %7B%0A        super();%0A        getSaveConfig().setFieldNames(true);%0A    %7D%0A%0A    @Override%0A    public void testEnded(String host) %7B%0A        super.testEnded(host);%0A        try %7B%0A            // hack for JMeter %3C 2.12 (BUG #56807)%0A            ResultCollector.class.getDeclaredMethod(%22flushFile%22);%0A            flushFile();%0A        %7D catch (NoSuchMethodException e) %7B%0A            log.warn(%22Cannot flush PrintWriter to file%22);%0A        %7D
 %0A   

add hack for flush file (#183)