Simulation
A simulation generates data for one or more entities, or logical datasets, over a configurable period of time.
You can create and stream a simulation using the CLI. You can also call the Create Simulation and Stream Simulation API endpoints directly.
Entities
A simulation must include at least one entity, or logical dataset. Depending on how you maintain state, it may correspond to any of the following concepts:
- table
- collection
- namespace
- bucket
- relation
For example, the following definition specifies a single users
entity, which generates a new user object roughly once per second:
entities:
users:
rate: '1'
stream:
type: object
properties:
name:
type: string
age:
type: integer
minimum: 18
Each entity definition may have two keys: stream
and rate
.
Stream
An entity must specify a stream, which defines the schema and content of its generated data.
See the Stream reference for more details.
Rate
An entity's rate defines how frequently the entity generates a value, in Hertz. By default, this value is 0.00001157
, or once per day.
rngo builds in variance, so the observed rate over any sub-interval of the simulation may be higher or lower than the configured one.
The value is an expression so to make the rate increase over time, you could do something like this:
rate: "0.1 + (0.0001 * offset)"
stream:
...
The expression is sampled periodically over the course of the simulation, so the rate will change in steps.
Rates will always be adjusted to be greater than or equal to zero and less than 1000 Hz.
Seed
You may specify the integer that a simulation uses to seed its random number generator. For example:
seed: 41
entities:
names:
stream:
type: string
Simulation data is deterministic, so changing the seed lets you get a fresh set of data for an otherwise identical simulation.