Search in sources :

Example 1 with AbstractGraphPanelVisualizer

use of kg.apc.jmeter.graphs.AbstractGraphPanelVisualizer in project jmeter-plugins by undera.

the class PluginsCMDWorker method doJob.

public int doJob() {
    checkParams();
    AbstractGraphPanelVisualizer pluginInstance = pluginType;
    pluginType.setIgnoreCurrentTestStartTime();
    setOptions(pluginInstance);
    CorrectedResultCollector rc;
    rc = (CorrectedResultCollector) pluginInstance.createTestElement();
    rc.setExcludeLabels(excludeLabels);
    rc.setIncludeLabels(includeLabels);
    rc.setStartOffset(startOffset);
    rc.setEndOffset(endOffset);
    if (includeSamplesWithRegex >= 0) {
        rc.setEnabledIncludeRegex(includeSamplesWithRegex != 0);
    }
    if (excludeSamplesWithRegex >= 0) {
        rc.setEnabledExcludeRegex(excludeSamplesWithRegex != 0);
    }
    if (successFilter >= 0) {
        rc.setErrorLogging(successFilter == 0);
        rc.setSuccessOnlyLogging(successFilter != 0);
    }
    if (pluginType.getStaticLabel().equals(JMeterPluginsUtils.prefixLabel("Merge Results"))) {
        mergeResults(pluginInstance, rc);
    } else {
        log.debug("Using JTL file: " + inputFile);
        rc.setFilename(inputFile);
        rc.setListener(pluginInstance);
        pluginInstance.configure(rc);
        // rc.testStarted();
        rc.loadExistingFile();
    // rc.testEnded();
    }
    // to handle issue 64 and since it must be cheap - set options again
    setOptions(pluginInstance);
    if ((exportMode & EXPORT_PNG) == EXPORT_PNG) {
        File pngFile = new File(outputPNG);
        forceDir(pngFile);
        try {
            pluginInstance.getGraphPanelChart().saveGraphToPNG(pngFile, graphWidth, graphHeight);
        } catch (IOException ex) {
            throw new RuntimeException(ex);
        }
    }
    if ((exportMode & EXPORT_CSV) == EXPORT_CSV) {
        File csvFile = new File(outputCSV);
        forceDir(csvFile);
        try {
            pluginInstance.getGraphPanelChart().saveGraphToCSV(csvFile);
        } catch (IOException ex) {
            throw new RuntimeException(ex);
        }
    }
    return 0;
}
Also used : AbstractGraphPanelVisualizer(kg.apc.jmeter.graphs.AbstractGraphPanelVisualizer) IOException(java.io.IOException) File(java.io.File) CorrectedResultCollector(kg.apc.jmeter.vizualizers.CorrectedResultCollector)

Aggregations

File (java.io.File)1 IOException (java.io.IOException)1 AbstractGraphPanelVisualizer (kg.apc.jmeter.graphs.AbstractGraphPanelVisualizer)1 CorrectedResultCollector (kg.apc.jmeter.vizualizers.CorrectedResultCollector)1