loadtest

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: MIT Imports: 26 Imported by: 0

README

Description

This directory (itest/loadtest) includes all files and data related to running the loadtesting suite for taproot assets daemon. These tests use the existing itest framework to run against real external running daemons.

The configuration file needs to be named loadtest.conf and must be placed on the working directory in order for the loadtest executable to detect it. A sample configuration can be found in loadtest-sample.conf which includes all the fields that are required for the tests to run successfully. This includes connection credentials for the tapd & lnd nodes, as well as a bitcoind backend.

For further tracking and metrics, a prometheus gateway is configured and used by the loadtests in order to submit any desired data in-flight.

Building

To create the loadtest executable run make build-loadtest. This will create a loadtest binary in your working directory which you can run, given that you have a correct loadtest.conf in the same directory.

The executable will consult the appropriate fields of loadtest.conf and it's going to run the defined test case with the respective config.

Example: To run a mint loadtest which mints batches of 450 assets we will define test-case="mint" and mint-test-batch-size=450 in our loadtest.conf.

Using dev-resources docker setup

You can use any kind of external running daemon, as long as it's reachable. The easiest way to spin up some nodes from scratch for the purpose of the loadtests is to run the dev-resources/docker-regtest setup and use alice, alice-tapd, bob, bob-tapd and the single bitcoind instance.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BitcoinConfig

type BitcoinConfig struct {
	Host     string `long:"host" description:"bitcoind/btcd instance address"`
	Port     int    `long:"port" description:"bitcoind/btcd instance port"`
	User     string `long:"user" description:"bitcoind/btcd user name"`
	Password string `long:"password" description:"bitcoind/btcd password"`
	TLSPath  string `long:"tlspath" description:"Path to btcd's TLS certificate, if TLS is enabled"`
}

BitcoinConfig defines exported config options for the connection to the btcd/bitcoind backend.

type Config

type Config struct {
	// TestCases is a comma separated list of test cases that will be
	// executed.
	TestCases []string `long:"test-case" description:"the test case that will be executed"`

	// Alice is the configuration for the main user in the network.
	Alice *User `group:"alice" namespace:"alice" description:"alice related configuration"`

	// Bob is the configuration for the secondary user in the network.
	Bob *User `group:"bob" namespace:"bob" description:"bob related configuration"`

	// Network is the network that the nodes are connected to.
	Network string `long:"network" description:"the network the nodes are connected to" choice:"regtest" choice:"testnet" choice:"mainnet"`

	// Bitcoin is the configuration for the bitcoin backend.
	Bitcoin *BitcoinConfig `group:"bitcoin" namespace:"bitcoin" long:"bitcoin" description:"bitcoin client configuration"`

	// BatchSize is the number of assets to mint in a single batch. This is
	// only relevant for the mint test.
	BatchSize int `long:"mint-test-batch-size" description:"the number of assets to mint in a single batch; only relevant for the mint test"`

	// NumSends is the number of asset sends to perform. This is only
	// relevant for the send test.
	NumSends int `long:"send-test-num-sends" description:"the number of send operations to perform; only relevant for the send test"`

	// NumAssets is the number of assets to send in each send operation.
	// This is only relevant for the send test.
	NumAssets uint64 `` /* 126-byte string literal not displayed */

	// SendType is the type of asset to attempt to send. This is only
	// relevant for the send test.
	SendType taprpc.AssetType `long:"send-test-send-type" description:"the type of asset to attempt to send; only relevant for the send test"`

	// TestSuiteTimeout is the timeout for the entire test suite.
	TestSuiteTimeout time.Duration `long:"test-suite-timeout" description:"the timeout for the entire test suite"`

	// TestTimeout is the timeout for each test.
	TestTimeout time.Duration `long:"test-timeout" description:"the timeout for each test"`

	// PrometheusGateway is the configuration for the Prometheus
	// PushGateway.
	PrometheusGateway *PrometheusGatewayConfig `group:"prometheus-gateway" namespace:"prometheus-gateway" description:"Prometheus PushGateway configuration"`
}

Config holds the main configuration for the performance testing binary.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns the default configuration for the performance testing binary.

func LoadConfig

func LoadConfig() (*Config, error)

LoadConfig initializes and parses the config using a config file and command line options.

The configuration proceeds as follows:

  1. Start with a default config with sane settings
  2. Load configuration file overwriting defaults with any specified options

func ValidateConfig

func ValidateConfig(cfg Config) (*Config, error)

ValidateConfig validates the given configuration and returns a clean version of it with sane defaults.

type LndConfig added in v0.4.0

type LndConfig struct {
	Name string `long:"name" description:"the name of the lnd instance"`
	Host string `long:"host" description:"the host to connect to"`
	Port int    `long:"port" description:"the port to connect to"`

	TLSPath string `long:"tlspath" description:"Path to lnd's TLS certificate, leave empty if TLS is disabled"`
	MacPath string `long:"macpath" description:"Path to tlnd's macaroon file"`
}

LndConfig are the main parameters needed for identifying and creating a grpc client to a lnd subsystem.

type PrometheusGatewayConfig added in v0.5.0

type PrometheusGatewayConfig struct {
	Enabled bool   `long:"enabled" description:"Enable pushing metrics to Prometheus PushGateway"`
	Host    string `long:"host" description:"Prometheus PushGateway host address"`
	Port    int    `long:"port" description:"Prometheus PushGateway port"`
	PushURL string
}

PrometheusGatewayConfig defines exported config options for connecting to the Prometheus PushGateway.

type TapConfig

type TapConfig struct {
	Name string `long:"name" description:"the name of the tapd instance"`
	Host string `long:"host" description:"the host to connect to"`
	Port int    `long:"port" description:"the port to connect to"`

	TLSPath string `long:"tlspath" description:"Path to tapd's TLS certificate, leave empty if TLS is disabled"`
	MacPath string `long:"macpath" description:"Path to tapd's macaroon file"`
}

TapConfig are the main parameters needed for identifying and creating a grpc client to a tapd subsystem.

type User

type User struct {
	Tapd *TapConfig `group:"tapd"  namespace:"tapd"`
	Lnd  *LndConfig `group:"lnd" namespace:"lnd"`
}

User defines the config options for a user in the network.

Jump to

Keyboard shortcuts

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