package de.jeha.s3pt.operations;

import de.jeha.s3pt.OperationResult;
import org.apache.commons.math3.stat.descriptive.DescriptiveStatistics;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.concurrent.Callable;

/**
 * @author jenshadlich@googlemail.com
 */
public abstract class AbstractOperation implements Callable<OperationResult> {

    private final static Logger LOG = LoggerFactory.getLogger(AbstractOperation.class);

    private final DescriptiveStatistics stats = new DescriptiveStatistics();

    protected DescriptiveStatistics getStats() {
        return stats;
    }

    protected void logStatistics() {
        LOG.info("Request statistics:");
        LOG.info("min = {} ms", (int) stats.getMin());
        LOG.info("max = {} ms", (int) stats.getMax());
        LOG.info("avg = {} ms", (int) stats.getGeometricMean());
        LOG.info("p50 = {} ms", (int) stats.getPercentile(50));
        LOG.info("p75 = {} ms", (int) stats.getPercentile(75));
        LOG.info("p95 = {} ms", (int) stats.getPercentile(95));
        LOG.info("p98 = {} ms", (int) stats.getPercentile(98));
        LOG.info("p99 = {} ms", (int) stats.getPercentile(99));
    }

}

@@ -608,586 +608,6 @@
  %7D%0A%0A
-    protected void logStatistics() %7B%0A        LOG.info(%22Request statistics:%22);%0A        LOG.info(%22min = %7B%7D ms%22, (int) stats.getMin());%0A        LOG.info(%22max = %7B%7D ms%22, (int) stats.getMax());%0A        LOG.info(%22avg = %7B%7D ms%22, (int) stats.getGeometricMean());%0A        LOG.info(%22p50 = %7B%7D ms%22, (int) stats.getPercentile(50));%0A        LOG.info(%22p75 = %7B%7D ms%22, (int) stats.getPercentile(75));%0A        LOG.info(%22p95 = %7B%7D ms%22, (int) stats.getPercentile(95));%0A        LOG.info(%22p98 = %7B%7D ms%22, (int) stats.getPercentile(98));%0A        LOG.info(%22p99 = %7B%7D ms%22, (int) stats.getPercentile(99));%0A    %7D%0A%0A
 %7D%0A

remove unused code