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
}
[
"5DwIT0u7K/GDne5GbYUstb5qYaqaDGEX",
"vWdD59yXhXOZjmheiFyzYfhsl0Ygvr+w",
"EQCydlRXGMMPQGzI46GI//EQWetvvOYm",
"Vd+9b4O4lnDW2fm/Utg97twL9mIFg1zM",
"Fq1oLYxHiib0UCeYSVmbVt1TszUaVytA"
]
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
]
}
}
[
"vWdD59yXhXOZjmheiFyzYQ==",
"EQCydlRXGMMPQGzI46GI",
"Vd+9b4O4lnDW2fm/Utg97twL9mIFg1zMFq1oLYxHiib0UCeYSQ==",
"8n9y0380e12ZeRYs+pWd",
"l+lTwAJsxKResy+Sgp6NFO6CfJTtyTUX732kwM4pcsybBgsItkYIUfOjoFuxAvcy"
]
Specification
JSON schema
{
"type": "object",
"properties": {
"size": {
"oneOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "object",
"properties": {
"_gen": {
"type": "string"
}
},
"required": [
"_gen"
]
}
]
}
},
"required": [
"size"
]
}