public abstract class AbstractGraphConsumer extends AbstractSampleConsumer
The class AbstractGraphConsumer provides a consumer that build a sorted map from samples. It uses a projection to define the key (x-axis coordinate) and an aggregator to define the value (y-axis coordinate).
About the seriesData:Series are defined by the seriesSelector, so they can be static or dynamic (sample linked) depending on the implementation of the selector.
About the groupData:The grapher build an aggregator for each seriesData/key pair using an external factory. All groupData from a series do the same aggregate calculation.
About the keys (x-axis coordinates):Keys are defined by the keysSelector for each seriesData, so the keys can be different depending on the seriesData
About the values (y-axis coordinates):Values are defined by the result aggregate produced by each aggregator. During consumption, values to add to the groupData are defined by the valueSelector.
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_AGGREGATED_KEYS_SERIES_FORMAT |
protected static String |
DEFAULT_GROUP |
static String |
DEFAULT_OVERALL_SERIES_FORMAT |
static String |
RESULT_MAX_X |
static String |
RESULT_MAX_Y |
static String |
RESULT_MIN_X |
static String |
RESULT_MIN_Y |
static String |
RESULT_SERIES |
static String |
RESULT_SERIES_DATA |
static String |
RESULT_SERIES_IS_CONTROLLER |
static String |
RESULT_SERIES_IS_OVERALL |
static String |
RESULT_SERIES_NAME |
static String |
RESULT_SUPPORTS_CONTROLLERS_DISCRIMINATION |
static String |
RESULT_TITLE |
Modifier | Constructor and Description |
---|---|
protected |
AbstractGraphConsumer() |
Modifier and Type | Method and Description |
---|---|
void |
consume(Sample sample,
int channel)
Consumes the specified sample ton the specified channel.
|
protected abstract Map<String,GroupInfo> |
createGroupInfos() |
protected abstract GraphKeysSelector |
createKeysSelector() |
protected MapResultData |
createSerieResult(String series,
SeriesData seriesData) |
String |
getAggregatedKeysSeriesFormat()
Gets the format for the name of aggregated keys seriesData.
|
protected HashMap<String,GroupInfo> |
getGroupInfos()
Gets the group information.
|
protected boolean |
getInvertsKeysAndValues()
Get flag to indicate we should swap keys and values.
|
protected GraphKeysSelector |
getKeysSelector()
Gets the keys selector.
|
String |
getOverallSeriesFormat()
Gets the format of the "overall" seriesData name.
|
String |
getTitle()
Gets the title of the graph.
|
void |
initialize() |
protected abstract void |
initializeExtraResults(MapResultData parentResult)
Inherited classes can add properties to the result
|
boolean |
rendersPercentiles()
Indicates if the graph renders percentiles.
|
void |
setAggregatedKeysSeriesFormat(String aggregatedKeysSeriesFormat)
Sets the format for the name of aggregated keys seriesData.
|
void |
setOverallSeriesFormat(String overallSeriesFormat)
Sets the format of the "overall" seriesData name.
|
void |
setRenderPercentiles(boolean renderPercentiles)
Enables or disables the percentiles render.
|
protected void |
setRevertKeysAndValues(boolean invertKeysAndValues)
Set flag to indicate we should swap keys and values.
|
void |
setTitle(String title)
Sets the title of the graph.
|
void |
startConsuming()
Start the sample consuming.
|
void |
stopConsuming()
Stops the consuming process.
|
addSampleConsumer, getConsumedChannelCount, getConsumedMetadata, getConsumer, getDataFromContext, getName, getWorkingDirectory, produce, removeSampleConsumer, setChannelAttribute, setConsumedMetadata, setDataToContext, setName, setProducedMetadata, setSampleConsumer, setSampleConsumers, setSampleContext, startProducing, stopProducing
getChannelAttribute, getSampleContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getChannelAttribute, getSampleContext
protected static final String DEFAULT_GROUP
public static final String RESULT_MIN_X
public static final String RESULT_MAX_X
public static final String RESULT_MIN_Y
public static final String RESULT_MAX_Y
public static final String RESULT_TITLE
public static final String RESULT_SUPPORTS_CONTROLLERS_DISCRIMINATION
public static final String RESULT_SERIES
public static final String RESULT_SERIES_NAME
public static final String RESULT_SERIES_DATA
public static final String RESULT_SERIES_IS_CONTROLLER
public static final String RESULT_SERIES_IS_OVERALL
public static final String DEFAULT_OVERALL_SERIES_FORMAT
public static final String DEFAULT_AGGREGATED_KEYS_SERIES_FORMAT
protected final HashMap<String,GroupInfo> getGroupInfos()
protected final boolean getInvertsKeysAndValues()
protected final void setRevertKeysAndValues(boolean invertKeysAndValues)
invertKeysAndValues
- the reverts keys and valuespublic final boolean rendersPercentiles()
public final void setRenderPercentiles(boolean renderPercentiles)
renderPercentiles
- flag to render percentiles or notprotected final GraphKeysSelector getKeysSelector()
public final String getOverallSeriesFormat()
public final void setOverallSeriesFormat(String overallSeriesFormat)
overallSeriesFormat
- the name of "overall" seriesData to setpublic final String getAggregatedKeysSeriesFormat()
public final void setAggregatedKeysSeriesFormat(String aggregatedKeysSeriesFormat)
aggregatedKeysSeriesFormat
- the format for the name of aggregated keys seriesData to setpublic final String getTitle()
public final void setTitle(String title)
title
- the title to setprotected abstract GraphKeysSelector createKeysSelector()
protected MapResultData createSerieResult(String series, SeriesData seriesData)
series
- The series nameseriesData
- SeriesData
protected abstract void initializeExtraResults(MapResultData parentResult)
parentResult
- the parent resultpublic void startConsuming()
SampleConsumer
public void consume(Sample sample, int channel)
SampleConsumer
sample
- The sample to be consumedchannel
- The channel on which the sample is consumedpublic void stopConsuming()
SampleConsumer
public void initialize()
Copyright © 1998-2021 Apache Software Foundation. All Rights Reserved.