Search in sources :

Example 16 with CorrectedResultCollector

use of kg.apc.jmeter.vizualizers.CorrectedResultCollector in project jmeter-plugins by undera.

the class MergeResultsServiceTest method testMergeSamples_emptyFilename.

@Test
public void testMergeSamples_emptyFilename() throws Exception {
    CorrectedResultCollector crc = new CorrectedResultCollector();
    crc.getSaveConfig().setAsXml(false);
    crc.setFilename("");
    MergeResultsService instance = new MergeResultsService();
    instance.mergeSamples(crc, SAMPLES);
}
Also used : CorrectedResultCollector(kg.apc.jmeter.vizualizers.CorrectedResultCollector)

Example 17 with CorrectedResultCollector

use of kg.apc.jmeter.vizualizers.CorrectedResultCollector in project jmeter-plugins by undera.

the class PageDataExtractorOverTimeGui method configure.

@Override
public void configure(TestElement te) {
    super.configure(te);
    CorrectedResultCollector rc = (CorrectedResultCollector) te;
    JMeterProperty regexpValues = rc.getProperty(REGEXPS_PROPERTY);
    if (!(regexpValues instanceof NullProperty)) {
        JMeterPluginsUtils.collectionPropertyToTableModelRows((CollectionProperty) regexpValues, tableModel, columnClasses);
        regExps = (CollectionProperty) regexpValues;
    } else {
        log.warn("Received null property instead of collection");
    }
}
Also used : JMeterProperty(org.apache.jmeter.testelement.property.JMeterProperty) NullProperty(org.apache.jmeter.testelement.property.NullProperty) CorrectedResultCollector(kg.apc.jmeter.vizualizers.CorrectedResultCollector)

Example 18 with CorrectedResultCollector

use of kg.apc.jmeter.vizualizers.CorrectedResultCollector in project jmeter-plugins by undera.

the class PageDataExtractorOverTimeGui method modifyTestElement.

@Override
public void modifyTestElement(TestElement te) {
    super.modifyTestElement(te);
    if (grid.isEditing()) {
        grid.getCellEditor().stopCellEditing();
    }
    if (te instanceof CorrectedResultCollector) {
        CorrectedResultCollector rc = (CorrectedResultCollector) te;
        CollectionProperty rows = JMeterPluginsUtils.tableModelRowsToCollectionProperty(tableModel, REGEXPS_PROPERTY);
        rc.setProperty(rows);
    }
}
Also used : CollectionProperty(org.apache.jmeter.testelement.property.CollectionProperty) CorrectedResultCollector(kg.apc.jmeter.vizualizers.CorrectedResultCollector)

Example 19 with CorrectedResultCollector

use of kg.apc.jmeter.vizualizers.CorrectedResultCollector 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)

Example 20 with CorrectedResultCollector

use of kg.apc.jmeter.vizualizers.CorrectedResultCollector in project jmeter-plugins by undera.

the class AbstractGraphPanelVisualizerTest method testIncludeExcludeRegex_exclude_only.

@Test
public void testIncludeExcludeRegex_exclude_only() {
    CorrectedResultCollector instance = new CorrectedResultCollector();
    instance.setProperty(CorrectedResultCollector.EXCLUDE_SAMPLE_LABELS, "P[0-9].*");
    instance.setProperty(CorrectedResultCollector.EXCLUDE_REGEX_CHECKBOX_STATE, true);
    instance.testStarted();
    DebugVisualizer vis = new DebugVisualizer();
    instance.setListener(vis);
    vis.configure(instance);
    vis.lastLabel = null;
    SampleResult res = new SampleResult();
    res.setSampleLabel("P1_TEST");
    instance.sampleOccurred(new SampleEvent(res, "tg"));
    assertNull(vis.lastLabel);
    vis.lastLabel = null;
    SampleResult res1 = new SampleResult();
    res1.setSampleLabel("T1_TEST");
    instance.sampleOccurred(new SampleEvent(res1, "tg"));
    assertEquals("T1_TEST", vis.lastLabel);
}
Also used : SampleResult(org.apache.jmeter.samplers.SampleResult) CorrectedResultCollector(kg.apc.jmeter.vizualizers.CorrectedResultCollector) SampleEvent(org.apache.jmeter.samplers.SampleEvent)

Aggregations

CorrectedResultCollector (kg.apc.jmeter.vizualizers.CorrectedResultCollector)22 SampleEvent (org.apache.jmeter.samplers.SampleEvent)12 SampleResult (org.apache.jmeter.samplers.SampleResult)12 File (java.io.File)4 IOException (java.io.IOException)1 AbstractGraphPanelVisualizer (kg.apc.jmeter.graphs.AbstractGraphPanelVisualizer)1 SampleSaveConfiguration (org.apache.jmeter.samplers.SampleSaveConfiguration)1 CollectionProperty (org.apache.jmeter.testelement.property.CollectionProperty)1 JMeterProperty (org.apache.jmeter.testelement.property.JMeterProperty)1 NullProperty (org.apache.jmeter.testelement.property.NullProperty)1