performance

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsumerCoordinatorPair added in v0.0.5

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

ConsumerCoordinatorPair consumer and coordinator pair

type ConsumerOraclePair added in v0.0.7

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

ConsumerOraclePair consumer and oracle pair

type Contract added in v0.0.7

type Contract interface {
	Address() string
}

Contract is just a basic contract interface

type ContractsNodesJobsMap added in v0.0.7

type ContractsNodesJobsMap map[interface{}]map[client.Chainlink]NodeData

ContractsNodesJobsMap common contract to node to job id mapping for perf/soak tests

func (ContractsNodesJobsMap) FromJobsChan added in v0.0.7

func (c ContractsNodesJobsMap) FromJobsChan(jobsChan chan ContractsNodesJobsMap)

FromJobsChan fills ContractsNodesJobsMap from a chan used in parallel deployment

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 KeeperJobMap added in v0.0.5

type KeeperJobMap map[contracts.KeeperConsumer]map[client.Chainlink]string

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

type KeeperTest added in v0.0.5

type KeeperTest struct {
	TestOptions KeeperTestOptions
	Environment environment.Environment
	Blockchain  client.BlockchainClient
	Wallets     client.BlockchainWallets
	Deployer    contracts.ContractDeployer
	// common contracts
	Link      contracts.LinkToken
	GasFeed   contracts.MockGasFeed
	LinkFeed  contracts.MockETHLINKFeed
	Registry  contracts.KeeperRegistry
	Registrar contracts.UpkeepRegistrar
	// contains filtered or unexported fields
}

KeeperTest is the implementation of Test that will configure and execute soak test of Keeper contracts & jobs

func (*KeeperTest) RecordValues added in v0.0.5

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

RecordValues records Keeper metrics

func (*KeeperTest) Run added in v0.0.5

func (f *KeeperTest) Run() error

Run runs Keeper performance/soak test

func (*KeeperTest) Setup added in v0.0.5

func (f *KeeperTest) Setup() error

Setup setups Keeper performance/soak test

type KeeperTestOptions added in v0.0.5

type KeeperTestOptions struct {
	TestOptions
	PaymentPremiumPPB     uint32
	RegistryCheckGasLimit uint32
	BlockCountPerTurn     *big.Int
	StalenessSeconds      *big.Int
	GasCeilingMultiplier  uint16
	RoundTimeout          time.Duration
	TestDuration          time.Duration
}

KeeperTestOptions contains the parameters for the Keeper performance/soak test to be executed

type LimitErrGroup added in v0.0.7

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

LimitErrGroup implements the errgroup.Group interface, but limits goroutines to a execute at a max throughput.

func NewLimitErrGroup added in v0.0.7

func NewLimitErrGroup(rps int) *LimitErrGroup

NewLimitErrGroup initializes and returns a new rate limited errgroup

func (*LimitErrGroup) Go added in v0.0.7

func (e *LimitErrGroup) Go(fn func() error)

Go runs a new job as a goroutine. It will wait until the next available time so that the ratelimit is not exceeded.

func (*LimitErrGroup) Wait added in v0.0.7

func (e *LimitErrGroup) Wait() error

Wait will wait until all jobs are processed. Once Wait() is called, no more jobs can be added.

type NodeData added in v0.0.7

type NodeData interface {
	GetJobID() string
	GetProvingKeyHash() [32]byte
}

NodeData common node data

type OCRJobMap added in v0.0.5

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

type OCRTest added in v0.0.5

type OCRTest struct {
	TestOptions     OCRTestOptions
	ContractOptions contracts.OffchainOptions
	Environment     environment.Environment
	Blockchain      client.BlockchainClient
	Wallets         client.BlockchainWallets
	Deployer        contracts.ContractDeployer
	// contains filtered or unexported fields
}

OCRTest is the implementation of Test that will configure and execute soak test of OCR contracts & jobs

func (*OCRTest) RecordValues added in v0.0.5

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

RecordValues records OCR metrics

func (*OCRTest) Run added in v0.0.5

func (f *OCRTest) Run() error

Run runs OCR performance/soak test

func (*OCRTest) Setup added in v0.0.5

func (f *OCRTest) Setup() error

Setup setups OCR performance/soak test

type OCRTestOptions added in v0.0.5

type OCRTestOptions struct {
	TestOptions
	RoundTimeout time.Duration
	AdapterValue int
	TestDuration time.Duration
}

OCRTestOptions contains the parameters for the OCR soak test to be executed

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 PerfJobRunResult added in v0.0.7

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

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

type PerfRequestIDTestResults added in v0.0.7

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

PerfRequestIDTestResults is results traced and aggregated by request id, see models.DecodeLogTaskRun

func NewPerfRequestIDTestResults added in v0.0.7

func NewPerfRequestIDTestResults() *PerfRequestIDTestResults

NewPerfRequestIDTestResults returns an instance NewPerfRequestIDTestResults

func (*PerfRequestIDTestResults) Get added in v0.0.7

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

func (*PerfRequestIDTestResults) GetAll added in v0.0.7

GetAll returns all test results

type PerfRoundTestResults added in v0.0.7

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

PerfRoundTestResults 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 NewPerfTestResults added in v0.0.7

func NewPerfTestResults() PerfRoundTestResults

NewPerfTestResults returns an instance PerfRoundTestResults

func (PerfRoundTestResults) Get added in v0.0.7

func (f PerfRoundTestResults) Get(
	roundID int64,
	contract Contract,
	chainlink client.Chainlink,
) *PerfJobRunResult

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

func (PerfRoundTestResults) GetAll added in v0.0.7

GetAll returns the full map, not safe for concurrent actions

type RunlogNodeData added in v0.0.7

type RunlogNodeData struct {
	JobID string
}

RunlogNodeData node data required for runlog test

func (RunlogNodeData) GetJobID added in v0.0.7

func (n RunlogNodeData) GetJobID() string

GetJobID gets internal job id

func (RunlogNodeData) GetProvingKeyHash added in v0.0.7

func (n RunlogNodeData) GetProvingKeyHash() [32]byte

GetProvingKeyHash gets proving key hash for VRF

type RunlogTest added in v0.0.7

type RunlogTest struct {
	TestOptions RunlogTestOptions
	Environment environment.Environment
	Blockchain  client.BlockchainClient
	Wallets     client.BlockchainWallets
	Deployer    contracts.ContractDeployer
	Link        contracts.LinkToken
	// contains filtered or unexported fields
}

RunlogTest is the implementation of Test that will configure and execute soak test of Runlog contracts & jobs

func (*RunlogTest) RecordValues added in v0.0.7

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

RecordValues records Runlog metrics

func (*RunlogTest) Run added in v0.0.7

func (f *RunlogTest) Run() error

Run runs Runlog performance/soak test

func (*RunlogTest) Setup added in v0.0.7

func (f *RunlogTest) Setup() error

Setup setups Runlog performance/soak test

type RunlogTestOptions added in v0.0.7

type RunlogTestOptions struct {
	TestOptions
	AdapterValue int
}

RunlogTestOptions contains the parameters for the Runlog soak test to be executed

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

func NewKeeperTest added in v0.0.5

NewKeeperTest creates new Keeper performance/soak test

func NewOCRTest added in v0.0.5

func NewOCRTest(
	testOptions OCRTestOptions,
	contractOptions contracts.OffchainOptions,
	env environment.Environment,
	blockchain client.BlockchainClient,
	wallets client.BlockchainWallets,
	deployer contracts.ContractDeployer,
	adapter environment.ExternalAdapter,
) Test

NewOCRTest creates new OCR performance/soak test

func NewRunlogTest added in v0.0.7

NewRunlogTest creates new Runlog performance/soak test

func NewVRFTest added in v0.0.5

NewVRFTest creates new VRF performance/soak test

type TestOptions

type TestOptions struct {
	NumberOfContracts    int
	NumberOfRounds       int
	RoundTimeout         time.Duration
	TestDuration         time.Duration
	GracefulStopDuration time.Duration
}

TestOptions common perf/soak test options either TestDuration can be set or NumberOfRounds, or both

type VRFNodeData added in v0.0.7

type VRFNodeData struct {
	ProvingKeyHash [32]byte
	JobID          string
}

VRFNodeData VRF node data

func (VRFNodeData) GetJobID added in v0.0.7

func (n VRFNodeData) GetJobID() string

GetJobID gets internal job id

func (VRFNodeData) GetProvingKeyHash added in v0.0.7

func (n VRFNodeData) GetProvingKeyHash() [32]byte

GetProvingKeyHash gets proving key hash for VRF

type VRFProvingData added in v0.0.5

type VRFProvingData struct {
	ProvingKeyHash [32]byte
	JobID          string
}

VRFProvingData proving key and job ID pair

type VRFTest added in v0.0.5

type VRFTest struct {
	TestOptions VRFTestOptions
	Environment environment.Environment
	Blockchain  client.BlockchainClient
	Wallets     client.BlockchainWallets
	Deployer    contracts.ContractDeployer
	// contains filtered or unexported fields
}

VRFTest is the implementation of Test that will configure and execute soak test of VRF contracts & jobs

func (*VRFTest) RecordValues added in v0.0.5

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

RecordValues records VRF metrics

func (*VRFTest) Run added in v0.0.5

func (f *VRFTest) Run() error

Run runs VRF performance/soak test

func (*VRFTest) Setup added in v0.0.5

func (f *VRFTest) Setup() error

Setup setups VRF performance/soak test

type VRFTestOptions added in v0.0.5

type VRFTestOptions struct {
	TestOptions
}

VRFTestOptions contains the parameters for the VRF soak test to be executed

Jump to

Keyboard shortcuts

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