Interface SampleConsumer

  • All Implemented Interfaces:
    org.apache.jmeter.report.processor.SampleProcessor

    
    public interface SampleConsumer
     implements SampleProcessor
                        

    Defines a sample consumer

    A sample consumer is meant to consume samples in order to process them.

    A sample consumer can consume samples on different channels and each channel is assigned a single metadata structure.

    A sample consumer is passive, meaning that its consume() service must be called by a third party object.

    Sample metadata must be provided to the consumer before startConsuming() is called.

    The following sequence must be observed when consuming samples :

    • Call setConsumedMetadata() for each channel that will consume samples
    • Call startConsuming() before any call to consume()
    • Call consume() for each sample to be consumed by the consumer, specify the channel on which to consume
    • Call stopConsuming() after every sample has been consumed
    Since:

    3.0

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract void setConsumedMetadata(SampleMetadata sampleMetadata, int channel) Set the metadata of samples that will be consumed on the specified channel.
      abstract void startConsuming() Start the sample consuming.
      abstract void consume(Sample s, int channel) Consumes the specified sample ton the specified channel.
      abstract void stopConsuming() Stops the consuming process.
      • Methods inherited from class org.apache.jmeter.report.processor.SampleProcessor

        getChannelAttribute, getSampleContext, setChannelAttribute, setSampleContext
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • setConsumedMetadata

         abstract void setConsumedMetadata(SampleMetadata sampleMetadata, int channel)

        Set the metadata of samples that will be consumed on the specified channel.

        Parameters:
        sampleMetadata - The sample metadata that are being consumed for the associated channel
        channel - The channel whose sample metadata are being defined
      • startConsuming

         abstract void startConsuming()

        Start the sample consuming. This step is used by consumer to initialize their process.

      • consume

         abstract void consume(Sample s, int channel)

        Consumes the specified sample ton the specified channel.

        Parameters:
        s - The sample to be consumed
        channel - The channel on which the sample is consumed
      • stopConsuming

         abstract void stopConsuming()

        Stops the consuming process. No sample will be processed after this service has been called.