workload

package
v0.2012.4 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2021 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NameQueries is the name of the queries workload.
	NameQueries = "queries"

	// CfgConsensusNumKeptVersions is the number of last consensus state versions that the nodes are
	// keeping (e.g., due to a configured pruning policy). Versions older than that will not be
	// queried.
	//
	// Note that this is only for consensus state versions, not runtime versions.
	CfgConsensusNumKeptVersions = "queries.consensus.num_kept_versions"
	// CfgQueriesRuntimeEnabled configures whether runtime queries are enabled.
	CfgQueriesRuntimeEnabled = "queries.runtime.enabled"
)
View Source
const (
	// NameRuntime is the name of the runtime workload.
	NameRuntime = "runtime"

	// CfgRuntimeID is the runtime workload runtime ID.
	CfgRuntimeID = "runtime.runtime_id"
)
View Source
const (
	// NameCommission is the name of the commission schedule amendements
	// workload.
	NameCommission = "commission"
)
View Source
const (
	// NameDelegation is the name of the delegation workload.
	NameDelegation = "delegation"
)
View Source
const (
	// NameOversized is the name of the oversized workload.
	NameOversized = "oversized"
)
View Source
const (
	// NameParallel is the name of the parallel workload.
	NameParallel = "parallel"
)
View Source
const (
	// NameRegistration is the name of the registration workload.
	NameRegistration = "registration"
)
View Source
const (
	// NameTransfer is the name of the transfer workload.
	//
	// Transfer workload continuously submits transfer and burn transactions.
	NameTransfer = "transfer"
)

Variables

View Source
var ByName = map[string]Workload{
	NameCommission:   &commission{},
	NameDelegation:   &delegation{},
	NameOversized:    oversized{},
	NameParallel:     parallel{},
	NameQueries:      &queries{},
	NameRegistration: &registration{},
	NameRuntime:      &runtime{},
	NameTransfer:     &transfer{},
}

ByName is the registry of workloads that you can access with `--workload <name>` on the command line.

Flags has the workload flags.

View Source
var QueriesFlags = flag.NewFlagSet("", flag.ContinueOnError)

QueriesFlags are the queries workload flags.

View Source
var RuntimeFlags = flag.NewFlagSet("", flag.ContinueOnError)

RuntimeFlags are the runtime workload flags.

Functions

func FundAccountFromTestEntity

func FundAccountFromTestEntity(
	ctx context.Context,
	logger *logging.Logger,
	cnsc consensus.ClientBackend,
	to signature.Signer,
) error

FundAccountFromTestEntity funds an account from test entity.

Types

type Workload

type Workload interface {
	// NeedsFunds should return true if the workload requires funding.
	NeedsFunds() bool

	// Run executes the workload.
	// If `gracefulExit`'s deadline passes, it is not an error.
	// Return `nil` after any short-ish amount of time in that case.
	// Prefer to do at least one "iteration" even so.
	Run(
		gracefulExit context.Context,
		rng *rand.Rand,
		conn *grpc.ClientConn,
		cnsc consensus.ClientBackend,
		fundingAccount signature.Signer,
	) error
}

Workload is a DRBG-backed schedule of transactions.

Jump to

Keyboard shortcuts

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