Scalar functions
bytes
Commentary
added in 0.3.20
Generates random byte arrays of the specified size, which is mainly useful for increasing event size in performance testing.
Examples
Generating bytes
Use a constant to generate byte arrays of the same size.
{
"_gen": "bytes",
"size": 24
}
[
"NZ1BuveK/g3hu+euKMBFDOQ8CE9Luyvx",
"g53uRm2FLLW+amGqmgxhF71nQ+fcl4Vz",
"mY5oXohcs2H4bJdGIL6/sBEAsnZUVxjD",
"D0BsyOOhiP/xEFnrb7zmJlXfvW+DuJZw",
"1tn5v1LYPe7cC/ZiBYNczBataC2MR4om"
]
Varied sizes
Use a function to generate byte arrays of varying sizes, in this case between 10 and 50 bytes.
{
"_gen": "bytes",
"size": {
"_gen": "uniformDistribution",
"bounds": [
10,
50
]
}
}
[
"4bvnrijARQzkPAhPSw==",
"vmphqpoMYRe9Z0Pn3JeFc5mOaF6IXLNh+GyXRiC+v7ARALJ2VFc=",
"8RBZ62+85iZV371vg7iWcNbZ+b9S2D3u3Av2YgWDXMwWrWgtjEeKJg==",
"3VOzNRpXK0Dyf3LTfzR7XQ==",
"MqRhltksMEaX6VPAAmzEpA=="
]
Specification
JSON schema
{
"type": "object",
"properties": {
"size": {
"oneOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "object",
"properties": {
"_gen": {
"type": "string"
}
},
"required": [
"_gen"
]
}
]
}
},
"required": [
"size"
]
}