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
}
[
"ehvsgo+LrGH3WxnQ/FeCL/2LEf31fqLj",
"7R/IjJqXMTHPACADm360MKoRrycr1gMm",
"ohihIunL9pvbwsCsjnXV8y/YjLBwtmtL",
"PdyL6wxDLKFaXN9oPs38GWOWFuLN+tlP",
"kwrV7nNRxZi2evIkjQ5/tH7jDnQUvvhC"
]
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
]
}
}
[
"3RM0T7hyH/h0p8wnLucGMxhJiKDCcAq7W2owdueQ+uxO1USufaHqy4j9kZISYow=",
"9LxNtXpAh3r3q5i0mUMR+VeV7oRKbVE6vA==",
"eBf4OqjxpjNpE7PRf2bkln4hPdmxEF+f6uPcKZqr+eBPDs9jFB6Pi19dj7YgkxT6iA==",
"CZddVOY+wm9WH6HYgK6Vj2G0IKo=",
"+WAuppOcljsVH8sHZ0Joy+fSbevpNjmmj9pFS5IQuVEJwfZ3Ug=="
]
Specification
JSON schema
{
"type": "object",
"properties": {
"size": {
"oneOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "object",
"properties": {
"_gen": {
"type": "string"
}
},
"required": [
"_gen"
]
}
]
}
},
"required": [
"size"
]
}