Search in sources :

Example 6 with SampleException

use of org.apache.jmeter.report.core.SampleException in project jmeter by apache.

the class NormalizerSampleConsumer method createFormatter.

/**
     * @return null if format is ms or a SimpleDateFormat
     * @throws SampleException is format is none
     */
private SimpleDateFormat createFormatter() {
    if (SampleSaveConfiguration.NONE.equalsIgnoreCase(TIMESTAMP_FORMAT)) {
        throw new SampleException("'none' format for 'jmeter.save.saveservice.timestamp_format' property is not accepted for report generation");
    }
    log.info("Using format, '{}', to parse timeStamp field", TIMESTAMP_FORMAT);
    isMillisFormat = SampleSaveConfiguration.MILLISECONDS.equalsIgnoreCase(TIMESTAMP_FORMAT);
    SimpleDateFormat formatter = null;
    // Prepare for a pretty date
    if (!isMillisFormat) {
        formatter = new SimpleDateFormat(TIMESTAMP_FORMAT);
    }
    return formatter;
}
Also used : SampleException(org.apache.jmeter.report.core.SampleException) SimpleDateFormat(java.text.SimpleDateFormat)

Example 7 with SampleException

use of org.apache.jmeter.report.core.SampleException in project jmeter by apache.

the class AbstractSampleConsumer method produce.

@Override
public void produce(Sample s, int channel) {
    for (SampleConsumer consumer : this.sampleConsumers) {
        try {
            consumer.consume(s, channel);
            producedSampleCount++;
        } catch (Exception e) {
            throw new SampleException("Consumer failed with message :" + e.getMessage(), e);
        }
    }
}
Also used : SampleException(org.apache.jmeter.report.core.SampleException) SampleException(org.apache.jmeter.report.core.SampleException)

Aggregations

SampleException (org.apache.jmeter.report.core.SampleException)7 Sample (org.apache.jmeter.report.core.Sample)4 File (java.io.File)3 CsvFile (org.apache.jmeter.report.core.CsvFile)2 SimpleDateFormat (java.text.SimpleDateFormat)1 ArrayList (java.util.ArrayList)1 Date (java.util.Date)1 LinkedList (java.util.LinkedList)1 List (java.util.List)1 Map (java.util.Map)1 ExporterConfiguration (org.apache.jmeter.report.config.ExporterConfiguration)1 GraphConfiguration (org.apache.jmeter.report.config.GraphConfiguration)1 CsvSampleReader (org.apache.jmeter.report.core.CsvSampleReader)1 CsvSampleWriter (org.apache.jmeter.report.core.CsvSampleWriter)1 CsvFileSampleSource (org.apache.jmeter.report.processor.CsvFileSampleSource)1 FilterConsumer (org.apache.jmeter.report.processor.FilterConsumer)1 NormalizerSampleConsumer (org.apache.jmeter.report.processor.NormalizerSampleConsumer)1 SampleContext (org.apache.jmeter.report.processor.SampleContext)1 SampleSource (org.apache.jmeter.report.processor.SampleSource)1