Class AbstractSampleConsumer

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

    
    public abstract class AbstractSampleConsumer
    extends AbstractSampleProcessor implements SampleConsumer, SampleProducer
                        

    Base class for sample consumer implementations. Every sample consumer should extends this class to support basic consumer features.

    Since:

    3.0

    • Constructor Detail

      • AbstractSampleConsumer

        AbstractSampleConsumer()
    • Method Detail

      • getName

         String getName()

        Gets the name of the consumer.

        Returns:

        the name of the consumer

      • setName

         void setName(String name)

        Sets the name of the consumer.

        Parameters:
        name - the new name
      • setConsumedMetadata

         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
      • setChannelAttribute

         void setChannelAttribute(int channel, String key, Object value)

        Associate an attribute to the specified channel for this sample processor If the attribute already exist, it is replaced.

        Parameters:
        channel - The channel number to associate the attribute on
        key - The attribute key
        value - The attribute value to be set
      • setProducedMetadata

         void setProducedMetadata(SampleMetadata metadata, int channel)

        Set the metadata associated with the specified channel

        Parameters:
        metadata - The metadata to be associated to the specified channel
        channel - The channel whoses metadata are being associated with
      • startProducing

         void startProducing()

        Start producing samples, must be invoked before any call to produce()

      • produce

         void produce(Sample s, int channel)

        Produce a single sample on the specified channel

        Parameters:
        s - The sample produced
        channel - The channel on which is produced the sample
      • stopProducing

         void stopProducing()

        Stop producing samples, no produce() call should occur after this service has been called.