use of org.apache.jmeter.report.processor.ApdexSummaryConsumer in project jmeter by apache.
the class ReportGenerator method createApdexSummaryConsumer.
private ApdexSummaryConsumer createApdexSummaryConsumer() {
ApdexSummaryConsumer apdexSummaryConsumer = new ApdexSummaryConsumer();
apdexSummaryConsumer.setName(APDEX_SUMMARY_CONSUMER_NAME);
apdexSummaryConsumer.setHasOverallResult(true);
apdexSummaryConsumer.setThresholdSelector(sampleName -> {
ApdexThresholdsInfo info = new ApdexThresholdsInfo();
info.setSatisfiedThreshold(configuration.getApdexSatisfiedThreshold());
info.setToleratedThreshold(configuration.getApdexToleratedThreshold());
for (Map.Entry<String, Long[]> entry : configuration.getApdexPerTransaction().entrySet()) {
org.apache.oro.text.regex.Pattern regex = JMeterUtils.getPatternCache().getPattern(entry.getKey());
PatternMatcher matcher = JMeterUtils.getMatcher();
if (matcher.matches(sampleName, regex)) {
Long satisfied = entry.getValue()[0];
Long tolerated = entry.getValue()[1];
if (log.isDebugEnabled()) {
log.debug("Found match for sampleName:{}, Regex:{}, satisfied value:{}, tolerated value:{}", entry.getKey(), satisfied, tolerated);
}
info.setSatisfiedThreshold(satisfied);
info.setToleratedThreshold(tolerated);
break;
}
}
return info;
});
return apdexSummaryConsumer;
}
Aggregations