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
}
[
"Ni2s2XmxamzLmCf8vT/QiEFyDiHV308+",
"t1E1nXQYTwrX1fmKa1UAJtcdGCfvnP6Y",
"M/nZiLPa675P2oqMu0rYwFyBHFRU8UX4",
"MBdauKJCkOfym0Zjk3MnodUz5wNANxpy",
"K4xXGgU35oSQXZYa1TB2ZBeEWCyMpjd1"
]
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
]
}
}
[
"+dufkuE3AUhCym2EU6ZMiUYUD7bUnMr3y/knrWVxAQ6uYeLZUJw=",
"tWA2Srtf9prOqJZebUPVP2E7Xg==",
"OTL8SvkYmvkD5IFUBD9okngPeqcPRl4fSQJsouYsQm/CLMZ7wViWjPzJtTeB7qST",
"FBd/Q6gBl5j4NP50fxZs0Wvvhxu9Sz7ic+9O8Wh/cQ==",
"fOPlius3ENcJKjKXFbbLGEGGCkKg+s7p8t3EM+VBCZ0/KS+LgA=="
]
Specification
JSON schema
{
"type": "object",
"properties": {
"size": {
"oneOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "object",
"properties": {
"_gen": {
"type": "string"
}
},
"required": [
"_gen"
]
}
]
}
},
"required": [
"size"
]
}