performance

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FluxJobMap

type FluxJobMap map[contracts.FluxAggregator]map[client.Chainlink]string

FluxJobMap is a custom map type that holds the record of jobs by the contract instance and the chainlink node

type FluxTest

type FluxTest struct {
	TestOptions     FluxTestOptions
	ContractOptions contracts.FluxAggregatorOptions
	Environment     environment.Environment
	Blockchain      client.BlockchainClient
	Wallets         client.BlockchainWallets
	Deployer        contracts.ContractDeployer
	Prometheus      *client.Prometheus
	// contains filtered or unexported fields
}

FluxTest is the implementation of Test that will configure and execute a performance test of FluxAggregator contracts & jobs

func (*FluxTest) RecordValues

func (f *FluxTest) RecordValues(b ginkgo.Benchmarker) error

RecordValues will query all of the latencies of the FluxAggregator rounds and then record them within the test runner

func (*FluxTest) Run

func (f *FluxTest) Run() error

Run will start the performance test by creating all the jobs within all Chainlink nodes, subscribing to events and ensuring all responses are received.

func (*FluxTest) Setup

func (f *FluxTest) Setup() error

Setup will deploy all the contracts and create all the Chainlink jobs for the performance test

type FluxTestOptions

type FluxTestOptions struct {
	TestOptions
	RequiredSubmissions      int
	RestartDelayRounds       int
	NodePollTimePeriod       time.Duration
	MeasureLatenciesPerRound bool
}

FluxTestOptions contains the parameters for the performance test to be executed

type FluxTestResult

type FluxTestResult struct {
	StartTime time.Time
	EndTime   time.Time
}

FluxTestResult contains the start & end time of the round submission to calculate latency

type FluxTestResults

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

FluxTestResults is a complex map that holds all test data in a map by the round ID, then contract instance and then the Chainlink client

func NewFluxTestResults

func NewFluxTestResults() FluxTestResults

NewFluxTestResults returns an instance FluxTestResults with it fully initialised based on test param

func (FluxTestResults) Get

func (f FluxTestResults) Get(
	roundID int64,
	contract contracts.FluxAggregator,
	chainlink client.Chainlink,
) *FluxTestResult

Get a value from the test results map with nil checking to avoid panics

func (FluxTestResults) GetAll

GetAll returns the full map, not safe for concurrent actions

type PercentileReport

type PercentileReport struct {
	StdDev float64
	Max    float64
	Min    float64
	P99    float64
	P95    float64
	P90    float64
	P50    float64
}

PercentileReport common percentile report

func NewPercentileReport

func NewPercentileReport(data []time.Duration) (*PercentileReport, error)

NewPercentileReport calculates percentiles for arbitrary float64 data

func (*PercentileReport) PrintPercentileMetrics

func (m *PercentileReport) PrintPercentileMetrics()

PrintPercentileMetrics prints percentile metrics

type Test

type Test interface {
	Setup() error
	Run() error
	RecordValues(b ginkgo.Benchmarker) error
}

Test is the interface to be implemented for performance tests

func NewFluxTest

func NewFluxTest(
	testOptions FluxTestOptions,
	contractOptions contracts.FluxAggregatorOptions,
	env environment.Environment,
	blockchain client.BlockchainClient,
	wallets client.BlockchainWallets,
	deployer contracts.ContractDeployer,
	prom *client.Prometheus,
) Test

NewFluxTest returns an instantiated instance of FluxTest

type TestOptions

type TestOptions struct {
	NumberOfContracts int
	NumberOfRounds    int64
}

Jump to

Keyboard shortcuts

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