Skip to main content

Time Patterns

Description

Input plugin for generating events with specific patterns of distribution in time.

Time pattern is determined by four components:

  • Oscillator - defines the base frequency of event generation
  • Multiplier - multiplies the number of events by the specified value
  • Randomizer - increases or decreases the number of events
  • Spreader - distribute events within one time interval

Several time patterns can be merged to achieve complex distribution.

Parameters

Usage name: time_patterns

Supported modes: live, sample

ParameterExpected valueRequiredDescription
configs<list[str]>YesList of paths to time pattern configurations (several distributions are merged to resulting one)

Time pattern configuration

Time pattern configuration is a yaml file that has following format:

label: <str>

oscillator:
start: <str>
end: <str>
period: <int>
unit: { seconds | minutes | hours | days }

multiplier:
ratio: <int>

randomizer:
deviation: <float>
direction: { Decrease | Increase | Mixed }

spreader:
distribution: { Uniform | Triangular | Beta }
parameters:
<parameter name>: <parameter value>
...

Time pattern parameters description:

ParameterExpected valueDescription
oscillator.start<time> | <datetime> | <relative time> | nowStart time of distribution; If relative time is provided current time used as base point
oscillator.end<time> | <datetime> | <relative time> | now | neverEnd time of distribution; If relative time is provided oscillator.start used as base point
oscillator.period<int>Duration of one period
oscillator.unitseconds | minutes | hours | daysTime unit of the period
multiplier.ratio<int>Multiplication ratio for number of events
randomizer.deviation<float> (in range [0.0; 1.0])Deviation ratio for number of events
randomizer.directionDecrease | Increase | Mixed Direction of deviation for number of events
spreader.distributionUniform | Triangular | Beta Probability function for distribution event within interval
info

<relative time> - is expression in following format:

<expression> ::= [<sign>]<term>{<term>}...
<sign> ::= '+' | '-'
<term> ::= <value><unit>
<value> ::= <int>
<unit> ::= 'd' | 'h' | 'm' | 's'

Examples: 1m30s, +2h, -15m, +1d12h30m5s

warning

Value never cannot be used for oscillator.end in sample mode.

Spreader parameters for Uniform distribution:

ParameterExpected valueDescription
spreader.parameters.low<float> (in range [0.0; 1.0])Start point of distribution within interval where 0.0 is start and 1.0 is end of interval
spreader.parameters.high<float> (in range [0.0; 1.0])End point of distribution within interval where 0.0 is start and 1.0 is end of interval

Spreader parameters for Triangular distribution

ParameterExpected valueDescription
spreader.parameters.left<float> (in range [0.0; 1.0))Left point of distribution within interval where 0.0 is start and 1.0 is end of interval
spreader.parameters.mode<float> (in range [0.0; 1.0])Mode point of distribution within interval where 0.0 is start and 1.0 is end of interval
spreader.parameters.right<float> (in range (0.0; 1.0])Right point of distribution within interval where 0.0 is start and 1.0 is end of interval

Spreader parameters for Beta distribution:

ParameterExpected valueDescription
spreader.parameters.a<float> (in range [0.0; ∞))Parameter α of beta distribution
spreader.parameters.b<float> (in range [0.0; ∞))Parameter β of beta distribution

Example

time_patterns:
configs:
- "distribution1.yaml"
- "distribution2.yaml"
- "distribution3.yaml"