Class FilterConsumer
-
- All Implemented Interfaces:
-
org.apache.jmeter.report.processor.SampleConsumer
,org.apache.jmeter.report.processor.SampleProcessor
,org.apache.jmeter.report.processor.SampleProducer
public class FilterConsumer extends AbstractSampleConsumer
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
-
-
Field Summary
Fields Modifier and Type Field Description public SamplePredicate
samplePredicate
public String
name
public SampleContext
sampleContext
-
Constructor Summary
Constructors Constructor Description FilterConsumer()
-
Method Summary
Modifier and Type Method Description final SamplePredicate
getSamplePredicate()
Gets the sample predicate used to filter the samples. final void
setSamplePredicate(SamplePredicate samplePredicate)
Sets the sample predicate used to filter the samples. final boolean
isReverseFilter()
Checks if the filtering is reversed. void
startConsuming()
Start the sample consuming. void
consume(Sample sample, int channel)
Consumes the specified sample ton the specified channel. void
stopConsuming()
Stops the consuming process. final void
setReverseFilter(boolean reverseFilter)
Reverses the filtering decision. -
Methods inherited from class org.apache.jmeter.report.processor.AbstractSampleConsumer
addSampleConsumer, getConsumedChannelCount, getConsumedMetadata, getName, getWorkingDirectory, produce, removeSampleConsumer, setChannelAttribute, setConsumedMetadata, setName, setProducedMetadata, setSampleConsumer, setSampleConsumers, setSampleContext, startProducing, stopProducing
-
Methods inherited from class org.apache.jmeter.report.processor.AbstractSampleProcessor
getChannelAttribute, getSampleContext
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getSamplePredicate
final SamplePredicate getSamplePredicate()
Gets the sample predicate used to filter the samples.
- Returns:
the sample predicate used to filter the samples.
-
setSamplePredicate
final void setSamplePredicate(SamplePredicate samplePredicate)
Sets the sample predicate used to filter the samples.
- Parameters:
samplePredicate
- the new sample predicate.
-
isReverseFilter
final boolean isReverseFilter()
Checks if the filtering is reversed.
- Returns:
true if the filtering is reversed; otherwise false.
-
startConsuming
void startConsuming()
Start the sample consuming. This step is used by consumer to initialize their process.
-
consume
void consume(Sample sample, int channel)
Consumes the specified sample ton the specified channel.
- Parameters:
channel
- The channel on which the sample is consumed
-
stopConsuming
void stopConsuming()
Stops the consuming process. No sample will be processed after this service has been called.
-
setReverseFilter
final void setReverseFilter(boolean reverseFilter)
Reverses the filtering decision.
- Parameters:
reverseFilter
- the filter mode to set
-
-
-
-