loadTest

package
v0.0.0-...-19239a5 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2021 License: EUPL-1.2 Imports: 13 Imported by: 0

README

Load tests

First generate private/public RSA pair.

ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub

Then add public key to your user settings via UI. Then set all necessary environment variables.

API_SERVER_URL    - URL of server you are trying to test
OUTPUT_FILE       - Statistics from test will be written to this file
EXAMPLES_PATH     - Path to examples folder with invoice XMLs which load test will be submitting
USER_ID           - Test will be sending requests on behalf of this user
USER_PRIVATE_KEY  - Private key of user USER_ID
LOG_FILE          - File for saving logs from test session
THREAD_NUMBER     - Number of threads sending requests in parallel
ITERATIONS_NUMBER - Number of requests to send by single thread

At the end start tests using command

go run ./cmd/load-test

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	// contains filtered or unexported fields
}

func NewApp

func NewApp() *App

func (*App) Run

func (a *App) Run()

type EndpointStatistics

type EndpointStatistics struct {
	sync.RWMutex
	StatusCodes map[int]int
	Times       []time.Duration
}

type Examples

type Examples struct {
	UblCreditNote     []byte
	UblInvoice        []byte
	D16bInvoice       []byte
	UblViolatingRules []byte
	UblViolatingXsd   []byte
	UblLarge          []byte
}

func NewExamples

func NewExamples(path string) *Examples

type Statistics

type Statistics struct {
	CreditNote        *EndpointStatistics
	UblInvoice        *EndpointStatistics
	D16bInvoice       *EndpointStatistics
	GetInvoices       *EndpointStatistics
	UblRulesViolation *EndpointStatistics
	UblXsdViolation   *EndpointStatistics
	UblLarge          *EndpointStatistics
}

func NewStatistics

func NewStatistics() Statistics

func (*Statistics) Print

func (s *Statistics) Print(file string)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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