Sample

This plugin can be used to get n out of m messages (downsample). This allows you to reduce the amount of messages; the plugin starts blocking after a certain number of messages has been reached.

Parameters

SampleRatePerGroup (default: 1)

This value defines how many messages are passed through the filter in each group. By default this parameter is set to “1”.

SampleGroupSize (default: 2)

This value defines how many messages make up a group. Messages over SampleRatePerGroup within a group are filtered. By default this parameter is set to “2”.

SampleRateIgnore

This value defines a list of streams that should not be affected by sampling. This is useful for e.g. producers listening to “*”. By default this parameter is set to an empty list.

Examples

This example will block 8 from 10 messages:

exampleConsumer:
  Type: consumer.Console
  Streams: "*"
  Modulators:
    - filter.Sample:
      SampleRatePerGroup: 2
      SampleGroupSize: 10
      SampleIgnore:
        - foo
        - bar