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;
}
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);
}
}
}
Aggregations