Skip to main content

Generator configuration

repeat

Commentary

added in 0.0.37

local configuration

global configuration

The rate at which to generate an event multiple times. When an event is repeated, it is immediately selected to be sent to the associated connection on the next generation invocation. times represents the number of additional instances of the event.

Therefore, a times value of 1 generates an event twice: once for the original generation, and another time for the repetition.


Examples

Local configuration

Use localConfigs to set repeat locally for one generator.

{
"generators": [
{
"table": "orders",
"row": {
"orderId": {
"_gen": "uuid"
},
"orderDate": {
"_gen": "dateToday"
}
},
"localConfigs": {
"repeat": {
"rate": 0.1,
"times": {
"_gen": "uniformDistribution",
"bounds": [
1,
4
]
}
}
}
}
]
}

Global configuration

Use globalConfigs to set repeat globally for all generators.

{
"generators": [
{
"table": "orders",
"row": {
"orderId": {
"_gen": "uuid"
},
"orderDate": {
"_gen": "dateToday"
}
}
}
],
"globalConfigs": {
"repeat": {
"rate": 0.2,
"times": {
"_gen": "uniformDistribution",
"bounds": [
3,
4
]
}
}
}
}

Specification

JSON schema

{
"type": "object",
"properties": {
"rate": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"times": {
"oneOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "object",
"properties": {
"_gen": {
"type": "string"
}
},
"required": [
"_gen"
]
}
]
}
},
"required": [
"rate",
"times"
]
}