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
-
-
Field Summary
Fields Modifier and Type Field Description public String
name
public SampleContext
sampleContext
-
Constructor Summary
Constructors Constructor Description AbstractSampleConsumer()
-
Method Summary
Modifier and Type Method Description String
getName()
Gets the name of the consumer. void
setName(String name)
Sets the name of the consumer. final File
getWorkingDirectory()
void
setSampleContext(SampleContext sampleContext)
Set sample context that this consumer should rely on. void
addSampleConsumer(SampleConsumer consumer)
void
setSampleConsumer(SampleConsumer consumer)
void
removeSampleConsumer(SampleConsumer consumer)
void
setConsumedMetadata(SampleMetadata sampleMetadata, int channel)
Set the metadata of samples that will be consumed on the specified channel. SampleMetadata
getConsumedMetadata(int channel)
int
getConsumedChannelCount()
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. void
setProducedMetadata(SampleMetadata metadata, int channel)
Set the metadata associated with the specified channel void
startProducing()
Start producing samples, must be invoked before any call to produce()
void
produce(Sample s, int channel)
Produce a single sample on the specified channel void
stopProducing()
Stop producing samples, no produce()
call should occur after this service has been called.void
setSampleConsumers(List<SampleConsumer> consumers)
Sets the consumers -
Methods inherited from class org.apache.jmeter.report.processor.AbstractSampleProcessor
getChannelAttribute, getSampleContext
-
Methods inherited from class org.apache.jmeter.report.processor.SampleProcessor
setSampleContext
-
Methods inherited from class org.apache.jmeter.report.processor.SampleConsumer
consume, startConsuming, stopConsuming
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getWorkingDirectory
final File getWorkingDirectory()
-
setSampleContext
void setSampleContext(SampleContext sampleContext)
Set sample context that this consumer should rely on.
-
addSampleConsumer
void addSampleConsumer(SampleConsumer consumer)
-
setSampleConsumer
void setSampleConsumer(SampleConsumer consumer)
-
removeSampleConsumer
void removeSampleConsumer(SampleConsumer consumer)
-
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 channelchannel
- The channel whose sample metadata are being defined
-
getConsumedMetadata
SampleMetadata getConsumedMetadata(int channel)
-
getConsumedChannelCount
int getConsumedChannelCount()
-
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 onkey
- The attribute keyvalue
- 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 channelchannel
- 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 producedchannel
- 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.
-
setSampleConsumers
void setSampleConsumers(List<SampleConsumer> consumers)
Sets the consumers
- Parameters:
consumers
- for the samples (must not benull
)
-
-
-
-