Skip to main content

Generator configuration

history

Commentary​

added in 0.0.5

local configuration

global configuration

Deprecated: See maxHistoryEvents instead.

The number of events to retain in memory for this generator (defaults to 1000000). Increase this value to make lookup operations richer, decrease it to require less memory.

Note that history is only retained when other generators run a lookup against it. Otherwise, ShadowTraffic optimizes memory footprint by not storing history.


Examples​

Local configuration​

Use localConfigs to set the history limit locally for one generator.

{
"generators": [
{
"table": "orders",
"row": {
"orderId": {
"_gen": "uuid"
},
"orderDate": {
"_gen": "dateToday"
}
},
"localConfigs": {
"history": {
"events": {
"max": 5000
}
}
}
}
]
}

Global configuration​

Use globalConfigs to set the history limit globally for all generators.

{
"generators": [
{
"table": "orders",
"row": {
"orderId": {
"_gen": "uuid"
},
"orderDate": {
"_gen": "dateToday"
}
}
}
],
"globalConfigs": {
"history": {
"events": {
"max": 10000
}
}
}
}

Specification​

JSON schema​

{
"type": "object",
"properties": {
"events": {
"type": "object",
"properties": {
"max": {
"type": "integer",
"minimum": 0
}
}
}
}
}