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
Parameter | Expected value | Required | Description |
---|---|---|---|
configs | <list[str]> | Yes | List 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:
Parameter | Expected value | Description |
---|---|---|
oscillator.start | <time> | <datetime> | <relative time> | now | Start time of distribution; If relative time is provided current time used as base point |
oscillator.end | <time> | <datetime> | <relative time> | now | never | End time of distribution; If relative time is provided oscillator.start used as base point |
oscillator.period | <int> | Duration of one period |
oscillator.unit | seconds | minutes | hours | days | Time 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.direction | Decrease | Increase | Mixed | Direction of deviation for number of events |
spreader.distribution | Uniform | 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:
Parameter | Expected value | Description |
---|---|---|
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
Parameter | Expected value | Description |
---|---|---|
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:
Parameter | Expected value | Description |
---|---|---|
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"