Skip to main content

Generator configuration

discard

Commentary

added in 0.0.34

local configuration

global configuration

The rate at which to generate an event and not send it to the associated connection.


Examples

Local configuration

Use localConfigs to set discard locally for one generator.

{
"generators": [
{
"table": "orders",
"row": {
"orderId": {
"_gen": "uuid"
},
"orderDate": {
"_gen": "dateToday"
}
},
"localConfigs": {
"discard": {
"rate": 0.05
}
}
}
]
}

Global configuration

Use globalConfigs to set discard globally for all generators.

{
"generators": [
{
"table": "orders",
"row": {
"orderId": {
"_gen": "uuid"
},
"orderDate": {
"_gen": "dateToday"
}
}
}
],
"globalConfigs": {
"localConfigs": {
"discard": {
"rate": 0.02
}
}
}
}

Specification

JSON schema

{
"type": "object",
"properties": {
"rate": {
"type": "number",
"minimum": 0,
"maximum": 1
}
},
"required": [
"rate"
]
}