Documentation ¶
Index ¶
Constants ¶
const TailSize = 1024
TailSize specifies number of extra random bytes in the buffer tail.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Datagen ¶
type Datagen struct {
// contains filtered or unexported fields
}
Datagen represents an instance of the module for every VU.
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
Generator stores buffer of random bytes with some tail and returns data slices with an increasing offset so that we receive a different set of bytes after each call without re-generation of the entire buffer from scratch:
[<----------size----------><-tail->] [<----------slice0-------->........] [.<----------slice1-------->.......] [..<----------slice2-------->......]
func NewGenerator ¶
func (*Generator) GenPayload ¶
type Payload ¶
type Payload interface { // Reader returns io.Reader instance to read the payload. // Must not be called twice. Reader() io.Reader // Bytes is a helper which reads all data from Reader() into slice. // The sole purpose of this method is to simplify HTTP scenario, // where all payload needs to be read and wrapped. Bytes() []byte // Size returns payload size, which is equal to the total amount of data // that could be read from the Reader(). Size() int // Hash returns payload sha256 hash. Must be called after all data is read from the reader. Hash() string }
Payload represents arbitrary data to be packed into S3 or native object. Implementations could be thread-unsafe.
func NewFixedPayload ¶
type RootModule ¶
type RootModule struct{}
RootModule is the global module object type. It is instantiated once per test run and will be used to create k6/x/frostfs/registry module instances for each VU.
func (*RootModule) NewModuleInstance ¶
func (r *RootModule) NewModuleInstance(vu modules.VU) modules.Instance
NewModuleInstance implements the modules.Module interface and returns a new instance for each VU.