com.lazerycode.jmeter.analyzer.writer.AbstractTextWriter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jmeter-analysis-maven-plugin Show documentation
Show all versions of jmeter-analysis-maven-plugin Show documentation
Parses JMeter result files and computes performance indicators such as average request duration
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);
}
}