Print

Bench Input

BENCH is a number generator to basically create a stream that supplies never ending numbers in a loop. It’s useful for testing syntax of other Window and Query statements. And it’s also useful for benchmarking the performance of your queries, in case you need to tune formulas but do not have an extremely busy stream to test them.

Note, that the BENCH plugin is only available in on-prem deployments. (Not available on RioDB Cloud)

Parameters

ceiling

When bench generates numbers in a loop, how high do you want it to go before it restarts from zero? Value must be a positive integer.

increment

Generated numbers should increment by this factor after each record. If not specified, the default value is 1.

interval

A time interval between records. Sometimes, we don’t want BENCH to blast millions of records per second. Instead, we may want it to produce maybe one record per second so that we can observe what windows and queries are producing. The value must be a positive integer representing the interval in milliseconds.

number_fields

how many numeric fields would you like the generated records to have. The value should be a positive integer.

string_fields

how many string (alphanumeric) fields would you like the generated records to have. The value must be a positive integer.

string_values

sample strings to be rotated in a loop. Values must be separated by a pipe |. For instance, if you pass the values ‘aaa|bbb|ccc’, then the first record will have the field value ‘aaa’, the second ‘bbb’, the third ‘ccc’ and those values will be repeated in a loop.
If this field is not provided, RioDB will these defaults:
‘Alice|Bob|Carol|Dave||Eve|Frank|Gloria|Henry|Ivan|Judy’
Note that there’s a null entry between Dave and Eve.

Syntax

INPUT bench (
    ceiling <int value>
    increment <int value>
    interval <int value>
    string_fields <int value>
    string_values '<strings separated by | >'
)

Example

To generate numbers from 0 to 50 (in a loop), incrementing by 1, every half second, including one numeric field and one string field:

INPUT bench (
    ceiling 50 
    increment 1 
    interval 500 
    string_fields 1
)

Since it’s using the default string values, the following records will be generated:

0   Alice
1   Bob
2   Carol
...

The count will restart at 50, and the string names will just keep reclycling.

Next, to generate numbers from 0 to 2000000000 (in a loop), incrementing by 1, as fast as possible, alternating through strings SPY, TSLA, and GOOG:

INPUT bench (
    ceiling 2000000000
    increment 1 
    string_fields 1
    string_values 'SPY|TSLA|GOOG'
)
Table of Contents
Scroll to Top