Class FilterConsumer
java.lang.Object
org.apache.jmeter.report.processor.AbstractSampleProcessor
org.apache.jmeter.report.processor.AbstractSampleConsumer
org.apache.jmeter.report.processor.FilterConsumer
- All Implemented Interfaces:
SampleConsumer,SampleProcessor,SampleProducer
The class FilterConsumer provides a way to discard samples in a consumer chain. This class uses a predicate for the filtering decision.
- When reverseFilter is false, samples are discarded if none predicate is defined or samples don't match the predicate.
- When reverseFilter is true, samples are discarded if a predicate is defined and samples match the predicate.
- Since:
- 3.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidConsumes the specified sample ton the specified channel.final SamplePredicateGets the sample predicate used to filter the samples.final booleanChecks if the filtering is reversed.final voidsetReverseFilter(boolean reverseFilter) Reverses the filtering decision.final voidsetSamplePredicate(SamplePredicate samplePredicate) Sets the sample predicate used to filter the samples.voidStart the sample consuming.voidStops the consuming process.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, stopProducingMethods 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.SampleProcessor
getChannelAttribute, getSampleContext
-
Constructor Details
-
FilterConsumer
public FilterConsumer()
-
-
Method Details
-
isReverseFilter
public final boolean isReverseFilter()Checks if the filtering is reversed.- Returns:
- true if the filtering is reversed; otherwise false.
-
setReverseFilter
public final void setReverseFilter(boolean reverseFilter) Reverses the filtering decision.- Parameters:
reverseFilter- the filter mode to set
-
getSamplePredicate
Gets the sample predicate used to filter the samples.- Returns:
- the sample predicate used to filter the samples.
-
setSamplePredicate
Sets the sample predicate used to filter the samples.- Parameters:
samplePredicate- the new sample predicate.
-
startConsuming
public void startConsuming()Description copied from interface:SampleConsumerStart the sample consuming. This step is used by consumer to initialize their process. -
consume
Description copied from interface:SampleConsumerConsumes the specified sample ton the specified channel.- Parameters:
sample- The sample to be consumedchannel- The channel on which the sample is consumed
-
stopConsuming
public void stopConsuming()Description copied from interface:SampleConsumerStops the consuming process. No sample will be processed after this service has been called.
-