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
}
[
"HJYBAxfK0MxloAuF9w+3ud+oy27J6HzL",
"02rLw7Xqv9IlS3+kNi2s2XmxamzLmCf8",
"vT/QiEFyDiHV308+t1E1nXQYTwrX1fmK",
"a1UAJtcdGCfvnP6YM/nZiLPa675P2oqM",
"u0rYwFyBHFRU8UX4MBdauKJCkOfym0Zj"
]
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
]
}
}
[
"/AXFIEqHag17JZonhUpXmtwSbfdA7okq8k1vYMs=",
"4TcBSELKbYRTpkyJRhQPtg==",
"ZXEBDq5h4tlQnDVEV/rJyJEeCle1YDZKu1/2ms6o",
"m4nXAzLuz0g5MvxK",
"BD9okngPeqcPRl4fSQJsouYsQg=="
]
Specification
JSON schema
{
"type": "object",
"properties": {
"size": {
"oneOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "object",
"properties": {
"_gen": {
"type": "string"
}
},
"required": [
"_gen"
]
}
]
}
},
"required": [
"size"
]
}