org.apache.jmeter.report.processor

## Class AbstractSummaryConsumer<TData>

- java.lang.Object
- - org.apache.jmeter.report.processor.AbstractSampleProcessor
  - - org.apache.jmeter.report.processor.AbstractSampleConsumer
    - - org.apache.jmeter.report.processor.AbstractSummaryConsumer<TData>

- Type Parameters:
    `TData` - the type of data to process
  All Implemented Interfaces:
    SampleConsumer, SampleProcessor, SampleProducer
  Direct Known Subclasses:
    ApdexSummaryConsumer, ErrorsSummaryConsumer, StatisticsSummaryConsumer, Top5ErrorsBySamplerConsumer

      public abstract class AbstractSummaryConsumer<TData>
      extends AbstractSampleConsumer

  The class AbstractSummaryConsumer provides a base class for data of the dashboard page.
  Since:
    3.0

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `protected class` | `AbstractSummaryConsumer.SummaryInfo` The class SummaryInfo stores intermediate results.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `RESULT_VALUE_DATA`
    `static String` | `RESULT_VALUE_IS_CONTROLLER`
    `static String` | `RESULT_VALUE_ITEMS`
    `static String` | `RESULT_VALUE_OVERALL`
    `static String` | `RESULT_VALUE_SUPPORTS_CONTROLLERS_DISCRIMINATION`
    `static String` | `RESULT_VALUE_TITLES`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `AbstractSummaryConsumer(boolean supportsControllersDiscrimination)` Instantiates a new abstract summary consumer.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `consume(Sample sample, int channel)` Consumes the specified sample ton the specified channel.
    `protected abstract ListResultData` | `createDataResult(String key, TData data)` Creates a result item for information identified by the specified key.
    `protected abstract ListResultData` | `createResultTitles()` Creates the result containing titles of columns.
    `protected abstract String` | `getKeyFromSample(Sample sample)` Gets the identifier key from sample. This key is use identify the SummaryInfo linked with the sample
    `protected AbstractSummaryConsumer.SummaryInfo` | `getOverallInfo()` Gets the overall info.
    `protected Map<String,AbstractSummaryConsumer.SummaryInfo>` | `getSummaryInfos()` Gets the summary infos.
    `boolean` | `hasOverallResult()` Defines whether the result contains an overall item.
    `void` | `setHasOverallResult(boolean hasOverallResult)` Defines whether the result contains an overall item.
    `void` | `startConsuming()` Start the sample consuming.
    `void` | `stopConsuming()` Stops the consuming process.
    `boolean` | `suppportsControllersDiscrimination()` Indicates whether this summary can discriminate controller samples
    `protected abstract void` | `updateData(AbstractSummaryConsumer.SummaryInfo info, Sample sample)` Update the stored data with the data from the specified sample.

    - ### Methods inherited from class org.apache.jmeter.report.processor.AbstractSampleConsumer

      `addSampleConsumer, getConsumedChannelCount, getConsumedMetadata, getConsumer, getDataFromContext, getName, getWorkingDirectory, produce, removeSampleConsumer, setChannelAttribute, setConsumedMetadata, setDataToContext, setName, setProducedMetadata, setSampleConsumer, setSampleConsumers, setSampleContext, startProducing, stopProducing`

    - ### Methods inherited from class org.apache.jmeter.report.processor.AbstractSampleProcessor

      `getChannelAttribute, getSampleContext`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.apache.jmeter.report.processor.SampleProcessor

      `getChannelAttribute, getSampleContext`

- - ### Field Detail

    - #### RESULT_VALUE_DATA

          public static final String RESULT_VALUE_DATA

      See Also:
        Constant Field Values

    - #### RESULT_VALUE_IS_CONTROLLER

          public static final String RESULT_VALUE_IS_CONTROLLER

      See Also:
        Constant Field Values

    - #### RESULT_VALUE_ITEMS

          public static final String RESULT_VALUE_ITEMS

      See Also:
        Constant Field Values

    - #### RESULT_VALUE_OVERALL

          public static final String RESULT_VALUE_OVERALL

      See Also:
        Constant Field Values

    - #### RESULT_VALUE_SUPPORTS_CONTROLLERS_DISCRIMINATION

          public static final String RESULT_VALUE_SUPPORTS_CONTROLLERS_DISCRIMINATION

      See Also:
        Constant Field Values

    - #### RESULT_VALUE_TITLES

          public static final String RESULT_VALUE_TITLES

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### AbstractSummaryConsumer

          protected AbstractSummaryConsumer(boolean supportsControllersDiscrimination)

      Instantiates a new abstract summary consumer.
      Parameters:
        `supportsControllersDiscrimination` - indicates whether this summary can discriminate controller samples

  - ### Method Detail

    - #### hasOverallResult

          public final boolean hasOverallResult()

      Defines whether the result contains an overall item.
      Returns:
        true, if the result contains an overall item

    - #### setHasOverallResult

          public final void setHasOverallResult(boolean hasOverallResult)

      Defines whether the result contains an overall item.
      Parameters:
        `hasOverallResult` - true, if the result contains an overall item; false otherwise

    - #### suppportsControllersDiscrimination

          public final boolean suppportsControllersDiscrimination()

      Indicates whether this summary can discriminate controller samples
      Returns:
        true, if this summary can discriminate controller samples; false otherwise.

    - #### getOverallInfo

          protected final AbstractSummaryConsumer.SummaryInfo getOverallInfo()

      Gets the overall info.
      Returns:
        the overall info

    - #### getSummaryInfos

          protected final Map<String,AbstractSummaryConsumer.SummaryInfo> getSummaryInfos()

      Gets the summary infos.
      Returns:
        the summary infos

    - #### getKeyFromSample

          protected abstract String getKeyFromSample(Sample sample)

      Gets the identifier key from sample.
      This key is use identify the SummaryInfo linked with the sample
      Parameters:
        `sample` - the sample
      Returns:
        the key identifying the sample

    - #### createDataResult

          protected abstract ListResultData createDataResult(String key,
                                                             TData data)

      Creates a result item for information identified by the specified key.
      Parameters:
        `key` - the key
        `data` - the data
      Returns:
        the list result data

    - #### createResultTitles

          protected abstract ListResultData createResultTitles()

      Creates the result containing titles of columns.
      Returns:
        the list of titles

    - #### updateData

          protected abstract void updateData(AbstractSummaryConsumer.SummaryInfo info,
                                             Sample sample)

      Update the stored data with the data from the specified sample.
      Parameters:
        `info` - SummaryInfo
        `sample` - the sample

    - #### startConsuming

          public void startConsuming()

      Description copied from interface: `SampleConsumer`
      Start the sample consuming. This step is used by consumer to initialize their process.

    - #### consume

          public void consume(Sample sample,
                              int channel)

      Description copied from interface: `SampleConsumer`
      Consumes the specified sample ton the specified channel.
      Parameters:
        `sample` - The sample to be consumed
        `channel` - The channel on which the sample is consumed

    - #### stopConsuming

          public void stopConsuming()

      Description copied from interface: `SampleConsumer`
      Stops the consuming process. No sample will be processed after this service has been called.

Copyright © 1998-2019 Apache Software Foundation. All Rights Reserved.