datagen

package
v0.0.0-...-614bee3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 1, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
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.

func (*Datagen) Exports

func (d *Datagen) Exports() modules.Exports

Exports implements the modules.Instance interface and returns the exports of the JS module.

func (*Datagen) Generator

func (d *Datagen) Generator(size int) *Generator

type GenPayloadResponse

type GenPayloadResponse struct {
	Payload goja.ArrayBuffer
	Hash    string
}

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 NewGenerator(vu modules.VU, size int) Generator

func (*Generator) GenPayload

func (g *Generator) GenPayload(calcHash bool) GenPayloadResponse

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL