All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.lazerycode.jmeter.analyzer.writer.AbstractTextWriter Maven / Gradle / Ivy

Go to download

Parses JMeter result files and computes performance indicators such as average request duration

There is a newer version: 1.0.6
Show newest version
package com.lazerycode.jmeter.analyzer.writer;

import com.lazerycode.jmeter.analyzer.util.TemplateUtil;
import com.lazerycode.jmeter.analyzer.parser.AggregatedResponses;
import freemarker.template.Template;
import freemarker.template.TemplateException;

import java.io.IOException;
import java.util.Map;

/**
 * Abstract implementation providing a convenience method for Text writers.
 */
public abstract class AbstractTextWriter extends AbstractWriter {

  /**
   * Render given {@link com.lazerycode.jmeter.analyzer.parser.AggregatedResponses testResults} as text
   *
   * @param testResults results to render
   * @param out         output to write to
   * @throws java.io.IOException
   * @throws freemarker.template.TemplateException
   *
   */
  protected void renderText(Map testResults, String template,
                            java.io.Writer out) throws IOException, TemplateException {

    Map rootMap = TemplateUtil.getRootMap(testResults);

    Template root = TemplateUtil.getTemplate(template);

    // Merge data-model with template
    root.process(rootMap, out);
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy