Class AbstractSampleConsumer
java.lang.Object
org.apache.jmeter.report.processor.AbstractSampleProcessor
org.apache.jmeter.report.processor.AbstractSampleConsumer
- All Implemented Interfaces:
SampleConsumer,SampleProcessor,SampleProducer
- Direct Known Subclasses:
AbstractGraphConsumer,AbstractSummaryConsumer,AggregateConsumer,ExternalSampleSorter,FilterConsumer,NormalizerSampleConsumer,RequestsSummaryConsumer,SampleWriterConsumer,TaggerConsumer
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.
Every sample consumer should extends this class to support basic consumer features.
- Since:
- 3.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSampleConsumer(SampleConsumer consumer) intgetConsumedMetadata(int channel) protected SampleConsumergetConsumer(int i) protected final ObjectgetDataFromContext(String key) Gets the data identified by the specified key from the current sample contextgetName()Gets the name of the consumer.final FilevoidProduce a single sample on the specified channelvoidremoveSampleConsumer(SampleConsumer consumer) voidsetChannelAttribute(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.voidsetConsumedMetadata(SampleMetadata sampleMetadata, int channel) Set the metadata of samples that will be consumed on the specified channel.protected final voidsetDataToContext(String key, Object value) Store data in the current sample context with the specified key identifier.voidSets the name of the consumer.voidsetProducedMetadata(SampleMetadata metadata, int channel) Set the metadata associated with the specified channelvoidsetSampleConsumer(SampleConsumer consumer) voidsetSampleConsumers(List<SampleConsumer> consumers) Sets the consumersvoidsetSampleContext(SampleContext sampleContext) Set sample context that this consumer should rely on.voidStart producing samples, must be invoked before any call toproduce()voidStop producing samples, noproduce()call should occur after this service has been called.Methods inherited from class org.apache.jmeter.report.processor.AbstractSampleProcessor
getChannelAttribute, getSampleContextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.jmeter.report.processor.SampleConsumer
consume, startConsuming, stopConsumingMethods inherited from interface org.apache.jmeter.report.processor.SampleProcessor
getChannelAttribute, getSampleContext
-
Constructor Details
-
AbstractSampleConsumer
public AbstractSampleConsumer()
-
-
Method Details
-
getDataFromContext
Gets the data identified by the specified key from the current sample context- Parameters:
key- the key- Returns:
- the data
-
setDataToContext
Store data in the current sample context with the specified key identifier.- Parameters:
key- the keyvalue- the value
-
getName
Gets the name of the consumer.- Returns:
- the name of the consumer
-
setName
Sets the name of the consumer.- Parameters:
name- the new name
-
getWorkingDirectory
-
setSampleContext
Description copied from interface:SampleProcessorSet sample context that this consumer should rely on.- Specified by:
setSampleContextin interfaceSampleProcessor- Overrides:
setSampleContextin classAbstractSampleProcessor- Parameters:
sampleContext- the new sample context
-
setSampleConsumers
Sets the consumers- Parameters:
consumers- for the samples (must not benull)
-
addSampleConsumer
-
setSampleConsumer
-
removeSampleConsumer
-
setConsumedMetadata
Description copied from interface:SampleConsumerSet the metadata of samples that will be consumed on the specified channel.- Specified by:
setConsumedMetadatain interfaceSampleConsumer- Parameters:
sampleMetadata- The sample metadata that are being consumed for the associated channelchannel- The channel whose sample metadata are being defined
-
getConsumedMetadata
-
getConsumedChannelCount
public int getConsumedChannelCount() -
setChannelAttribute
Description copied from interface:SampleProcessorAssociate an attribute to the specified channel for this sample processor
If the attribute already exist, it is replaced.- Specified by:
setChannelAttributein interfaceSampleProcessor- Overrides:
setChannelAttributein classAbstractSampleProcessor- Parameters:
channel- The channel number to associate the attribute onkey- The attribute keyvalue- The attribute value to be set
-
setProducedMetadata
Description copied from interface:SampleProducerSet the metadata associated with the specified channel- Specified by:
setProducedMetadatain interfaceSampleProducer- Parameters:
metadata- The metadata to be associated to the specified channelchannel- The channel whoses metadata are being associated with
-
getConsumer
-
startProducing
public void startProducing()Description copied from interface:SampleProducerStart producing samples, must be invoked before any call toproduce()- Specified by:
startProducingin interfaceSampleProducer
-
produce
Description copied from interface:SampleProducerProduce a single sample on the specified channel- Specified by:
producein interfaceSampleProducer- Parameters:
s- The sample producedchannel- The channel on which is produced the sample
-
stopProducing
public void stopProducing()Description copied from interface:SampleProducerStop producing samples, noproduce()call should occur after this service has been called.- Specified by:
stopProducingin interfaceSampleProducer
-