org.apache.jmeter.report.processor

## Interface SampleProducer

- All Superinterfaces:
    SampleProcessor
  All Known Implementing Classes:
    AbstractGraphConsumer, AbstractOverTimeGraphConsumer, AbstractSampleConsumer, AbstractSummaryConsumer, AbstractVersusRequestsGraphConsumer, AbstractVersusThreadsGraphConsumer, ActiveThreadsGraphConsumer, AggregateConsumer, ApdexSummaryConsumer, BytesThroughputGraphConsumer, CodesPerSecondGraphConsumer, ConnectTimeOverTimeGraphConsumer, CustomGraphConsumer, ErrorsSummaryConsumer, ExternalSampleSorter, FilterConsumer, HitsPerSecondGraphConsumer, LatencyOverTimeGraphConsumer, LatencyVSRequestGraphConsumer, NormalizerSampleConsumer, RequestsSummaryConsumer, ResponseCustomGraphGraphConsumer, ResponseTimeDistributionGraphConsumer, ResponseTimeOverTimeGraphConsumer, ResponseTimePercentilesGraphConsumer, ResponseTimePercentilesOverTimeGraphConsumer, ResponseTimePerSampleGraphConsumer, ResponseTimeVSRequestGraphConsumer, SampleWriterConsumer, StatisticsSummaryConsumer, SyntheticResponseTimeDistributionGraphConsumer, TaggerConsumer, TimeVSThreadGraphConsumer, Top5ErrorsBySamplerConsumer, TotalTPSGraphConsumer, TransactionsPerSecondGraphConsumer

      public interface SampleProducer
      extends SampleProcessor

  Defines a sample producer

  A sample producer is able to produce sample on different channels.

  Typically, a `SampleProducer` can be connected to `SampleConsumer` where it will produced sample that will be consumed by the sample consumer.

  A sample producer can produce samples of different metadata for reach channel/

  The following production sequence must be observed:

  - Call `setProducedMetadata()` for each produced channel
  - Call `startProducing()`
  - Call `produce()` for each sample to produce for every channel
  - Call `stopProducing()`
  Since:
    3.0

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `produce(Sample s, int channel)` Produce a single sample on the specified channel
    `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` | `stopProducing()` Stop producing samples, no `produce()` call should occur after this service has been called.

    - ### Methods inherited from interface org.apache.jmeter.report.processor.SampleProcessor

      `getChannelAttribute, getSampleContext, setChannelAttribute, setSampleContext`

- - ### Method Detail

    - #### 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.

Copyright © 1998-2019 Apache Software Foundation. All Rights Reserved.