use of org.apache.jmeter.report.processor.MapResultData in project jmeter by apache.
the class AbstractDataExporter method findValue.
/**
* Finds a value matching the specified data name in a ResultData tree.
* Supports only MapResultData walking.
*
* @param clazz
* the type of the value
* @param data
* the name of the data containing the value
* @param root
* the root of the tree
* @param <T>
* type of value to be found
* @return the value matching the data name
*/
protected static <T> T findValue(Class<T> clazz, String data, ResultData root) {
T value = null;
ResultData result = findData(data, root);
if (result instanceof ValueResultData) {
ValueResultData valueResult = (ValueResultData) result;
Object object = valueResult.getValue();
if (object != null && clazz.isAssignableFrom(object.getClass())) {
value = clazz.cast(object);
}
}
return value;
}
use of org.apache.jmeter.report.processor.MapResultData in project jmeter by apache.
the class SyntheticResponseTimeDistributionGraphConsumer method create.
private MapResultData create(String serie, String color) {
GroupInfo groupInfo = getGroupInfos().get(AbstractGraphConsumer.DEFAULT_GROUP);
SeriesData seriesData = new SeriesData(groupInfo.getAggregatorFactory(), groupInfo.enablesAggregatedKeysSeries(), false, groupInfo.enablesOverallSeries());
MapResultData seriesResult = createSerieResult(serie, seriesData);
seriesResult.setResult(SERIE_COLOR_PROPERTY, new ValueResultData(color));
return seriesResult;
}
use of org.apache.jmeter.report.processor.MapResultData in project jmeter by apache.
the class AbstractGraphConsumer method stopConsuming.
/*
* (non-Javadoc)
*
* @see
* org.apache.jmeter.report.csv.processor.SampleConsumer#stopConsuming()
*/
/*
* (non-Javadoc)
*
* @see
* org.apache.jmeter.report.processor.graph.SampleConsumer#stopConsuming()
*/
@Override
public void stopConsuming() {
super.stopProducing();
MapResultData result = createResult();
// Get the aggregate results from the map
for (Map.Entry<String, GroupInfo> groupEntry : groupInfos.entrySet()) {
String groupName = groupEntry.getKey();
GroupInfo groupInfo = groupEntry.getValue();
GroupData groupData = groupInfo.getGroupData();
boolean overallSeries = groupInfo.enablesOverallSeries();
boolean aggregatedKeysSeries = groupInfo.enablesAggregatedKeysSeries();
for (Map.Entry<String, SeriesData> seriesEntry : groupData.getSeriesInfo().entrySet()) {
String seriesName = seriesEntry.getKey();
SeriesData seriesData = seriesEntry.getValue();
addKeyData(result, groupName, seriesName, seriesData, false);
if (aggregatedKeysSeries) {
addKeyData(result, groupName, seriesName, seriesData, true);
}
}
// Add overall values if needed
if (overallSeries) {
SeriesData overallData = groupData.getOverallSeries();
String overallSeriesName = String.format(overallSeriesFormat, groupName);
addKeyData(result, groupName, overallSeriesName, overallData, false);
if (aggregatedKeysSeries) {
addKeyData(result, groupName, overallSeriesName, overallData, true);
}
}
}
// Store the result
setDataToContext(getName(), result);
for (GroupInfo groupInfo : groupInfos.values()) {
groupInfo.getGroupData().clear();
}
}
use of org.apache.jmeter.report.processor.MapResultData in project jmeter by apache.
the class AbstractGraphConsumer method createSerieResult.
/**
* @param series The series name
* @param seriesData {@link SeriesData}
* @return MapResultData metadata for serie
*/
protected MapResultData createSerieResult(String series, SeriesData seriesData) {
MapResultData seriesResult = new MapResultData();
seriesResult.setResult(RESULT_SERIES_NAME, new ValueResultData(series));
seriesResult.setResult(RESULT_SERIES_IS_CONTROLLER, new ValueResultData(seriesData.isControllersSeries()));
seriesResult.setResult(RESULT_SERIES_IS_OVERALL, new ValueResultData(seriesData.isOverallSeries()));
seriesResult.setResult(RESULT_SERIES_DATA, new ListResultData());
return seriesResult;
}
Aggregations