Documentation ¶
Index ¶
- func EstimateCallCount(rates []int, durations []int, nRepeats *int) (int, error)
- type DeepOutput
- type Erc20TxBuilder
- type Erc721TxBuilder
- type ErrorPair
- type JsonError
- type JsonrpcMessage
- type LoadTest
- type LoadTestColumnWise
- type LoadTestDeepOutput
- type LoadTestDeepOutputDatum
- type LoadTestGenerator
- type LoadTestMode
- type LoadTestOutput
- type LoadTestOutputDatum
- type MultiLoadTestGenerator
- type MultiVegetaArgs
- type Node
- type Nodes
- type RandomSeed
- type RawLoadTestOutputDatum
- type ResponseCategory
- type RunType
- type SenderAccount
- type SingleRunResultsPayload
- type SingleRunTestPayload
- type TestGenerationParameters
- type TxBuilder
- type TxType
- type VegetaArgs
- type VegetaArgsShorthand
- type VegetaAttack
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DeepOutput ¶
type DeepOutput string
const ( RawDeepOutput DeepOutput = "raw" MetricsDeepOutput DeepOutput = "metrics" )
type Erc20TxBuilder ¶
type Erc20TxBuilder interface { TxBuilder // Returns the transfer token value GetTransferValue() (*big.Int, error) // Returns the token balance for the specified address GetTokenBalance(address common.Address) (*big.Int, error) // Returns the suppliers token balance GetSupplierBalance() (*big.Int, error) // Returns the token name GetTokenSymbol() string // Funds the specified account FundAccount(address common.Address, amount *big.Int) error }
type Erc721TxBuilder ¶
type Erc721TxBuilder interface { TxBuilder }
type JsonrpcMessage ¶
type JsonrpcMessage struct { Version string `json:"jsonrpc,omitempty"` ID int64 `json:"id,omitempty"` Method string `json:"method,omitempty"` Params []interface{} `json:"params,omitempty"` Error *JsonError `json:"error,omitempty"` Result json.RawMessage `json:"result,omitempty"` }
A value of this type can a JSON-RPC request, notification, successful response or error response. Which one it is depends on the fields.
type LoadTest ¶
type LoadTest struct { TestParameters TestGenerationParameters `json:"test_parameters"` Attacks []VegetaAttack `json:"attacks"` }
type LoadTestColumnWise ¶
type LoadTestDeepOutput ¶
type LoadTestDeepOutput struct { TargetRate []int `json:"target_rate"` ActualRate []*float64 `json:"actual_rate"` TargetDuration []int `json:"target_duration"` ActualDuration []*float64 `json:"actual_duration"` Requests []int `json:"requests"` Throughput []*float64 `json:"throughput"` Success []*float64 `json:"success"` Min []*float64 `json:"min"` Mean []*float64 `json:"mean"` P50 []*float64 `json:"p50"` P90 []*float64 `json:"p90"` P95 []*float64 `json:"p95"` P99 []*float64 `json:"p99"` Max []*float64 `json:"max"` StatusCodes []map[string]int `json:"status_codes"` Errors [][]string `json:"errors"` FirstRequestTimestamp []*string `json:"first_request_timestamp"` LastRequestTimestamp []*string `json:"last_request_timestamp"` LastResponseTimestamp []*string `json:"last_response_timestamp"` FinalWaitTime []*float64 `json:"final_wait_time"` NInvalidJSONErrors []int `json:"n_invalid_json_errors"` NRPCErrors []int `json:"n_rpc_errors"` }
type LoadTestDeepOutputDatum ¶
type LoadTestDeepOutputDatum struct { TargetRate int `json:"target_rate"` ActualRate *float64 `json:"actual_rate"` TargetDuration int `json:"target_duration"` ActualDuration *float64 `json:"actual_duration"` Requests int `json:"requests"` Throughput *float64 `json:"throughput"` Success *float64 `json:"success"` Min *float64 `json:"min"` Mean *float64 `json:"mean"` P50 *float64 `json:"p50"` P90 *float64 `json:"p90"` P95 *float64 `json:"p95"` P99 *float64 `json:"p99"` Max *float64 `json:"max"` StatusCodes map[string]int `json:"status_codes"` Errors []string `json:"errors"` FirstRequestTimestamp *string `json:"first_request_timestamp"` LastRequestTimestamp *string `json:"last_request_timestamp"` LastResponseTimestamp *string `json:"last_response_timestamp"` FinalWaitTime *float64 `json:"final_wait_time"` NInvalidJSONErrors int `json:"n_invalid_json_errors"` NRPCErrors int `json:"n_rpc_errors"` }
type LoadTestGenerator ¶
type LoadTestGenerator func(...interface{}) []VegetaAttack
type LoadTestMode ¶
type LoadTestMode string
const ( StressMode LoadTestMode = "stress" SpikeMode LoadTestMode = "spike" SoakMode LoadTestMode = "soak" )
type LoadTestOutput ¶
type LoadTestOutput struct { TargetRate []int `json:"target_rate"` ActualRate []*float64 `json:"actual_rate"` TargetDuration []int `json:"target_duration"` ActualDuration []*float64 `json:"actual_duration"` Requests []int `json:"requests"` Throughput []*float64 `json:"throughput"` Success []*float64 `json:"success"` Min []*float64 `json:"min"` Mean []*float64 `json:"mean"` P50 []*float64 `json:"p50"` P90 []*float64 `json:"p90"` P95 []*float64 `json:"p95"` P99 []*float64 `json:"p99"` Max []*float64 `json:"max"` StatusCodes []map[string]int `json:"status_codes"` Errors [][]string `json:"errors"` FirstRequestTimestamp []*string `json:"first_request_timestamp"` LastRequestTimestamp []*string `json:"last_request_timestamp"` LastResponseTimestamp []*string `json:"last_response_timestamp"` FinalWaitTime []*float64 `json:"final_wait_time"` DeepRawOutput []*string `json:"deep_raw_output"` DeepMetrics map[ResponseCategory]LoadTestDeepOutput `json:"deep_metrics"` DeepRPCErrorPairs [][]ErrorPair `json:"deep_rpc_error_pairs"` }
func BuildLoadTestOutput ¶
func BuildLoadTestOutput(listOfMaps []*LoadTestOutputDatum) LoadTestOutput
type LoadTestOutputDatum ¶
type LoadTestOutputDatum struct { TargetRate int `json:"target_rate"` ActualRate *float64 `json:"actual_rate"` TargetDuration int `json:"target_duration"` ActualDuration *float64 `json:"actual_duration"` Requests int `json:"requests"` Throughput *float64 `json:"throughput"` Success *float64 `json:"success"` Min *float64 `json:"min"` Mean *float64 `json:"mean"` P50 *float64 `json:"p50"` P90 *float64 `json:"p90"` P95 *float64 `json:"p95"` P99 *float64 `json:"p99"` Max *float64 `json:"max"` StatusCodes map[string]int `json:"status_codes"` Errors []string `json:"errors"` FirstRequestTimestamp *string `json:"first_request_timestamp"` LastRequestTimestamp *string `json:"last_request_timestamp"` LastResponseTimestamp *string `json:"last_response_timestamp"` FinalWaitTime *float64 `json:"final_wait_time"` DeepRawOutput *string `json:"deep_raw_output"` DeepMetrics map[ResponseCategory]LoadTestDeepOutputDatum `json:"deep_metrics"` DeepRPCErrorPairs []ErrorPair `json:"deep_rpc_error_pairs"` }
type MultiLoadTestGenerator ¶
type MultiVegetaArgs ¶
type MultiVegetaArgs []VegetaArgs
type RandomSeed ¶
type RandomSeed int64
type RawLoadTestOutputDatum ¶
type RawLoadTestOutputDatum struct { Latencies map[string]float64 `json:"latencies"` BytesIn map[string]float64 `json:"bytes_in"` BytesOut map[string]float64 `json:"bytes_out"` Earliest string `json:"earliest"` Latest string `json:"latest"` End string `json:"end"` Duration int `json:"duration"` Wait int `json:"wait"` Requests int `json:"requests"` Rate float64 `json:"rate"` Throughput float64 `json:"throughput"` Success float64 `json:"success"` StatusCodes map[string]int `json:"status_codes"` Errors []string `json:"errors"` FirstRequestTimestamp string `json:"first_request_timestamp"` LastRequestTimestamp string `json:"last_request_timestamp"` LastResponseTimestamp string `json:"last_response_timestamp"` FinalWaitTime int `json:"final_wait_time"` }
type ResponseCategory ¶
type ResponseCategory string
const ( AllResponses ResponseCategory = "all" SuccessfulResponses ResponseCategory = "successful" FailedResponses ResponseCategory = "failed" )
type SenderAccount ¶
type SenderAccount struct { MnemonicIndex int Nonce uint64 Wallet *accounts.Account Address common.Address PrivateKey *ecdsa.PrivateKey }
func NewSenderAccount ¶
func NewSenderAccount(mnemonicIndex int, nonce uint64, wallet *accounts.Account, privateKey *ecdsa.PrivateKey) (*SenderAccount, error)
func (*SenderAccount) GetAddress ¶
func (sa *SenderAccount) GetAddress() common.Address
func (*SenderAccount) GetNonce ¶
func (sa *SenderAccount) GetNonce() uint64
func (*SenderAccount) IncrNonce ¶
func (sa *SenderAccount) IncrNonce()
type SingleRunResultsPayload ¶
type SingleRunResultsPayload struct { DependencyVersions map[string]*string `json:"dependency_versions"` CLIArgs []string `json:"cli_args"` Type RunType `json:"type"` TRunStart int64 `json:"t_run_start"` TRunEnd int64 `json:"t_run_end"` Nodes Nodes `json:"nodes"` Results map[string]LoadTestOutput `json:"results"` }
type SingleRunTestPayload ¶
type SingleRunTestPayload struct { Type RunType `json:"type"` Name string `json:"name"` TestParameters TestGenerationParameters `json:"test_parameters"` }
type TestGenerationParameters ¶
type TestGenerationParameters struct { TestName string `json:"test_name"` RandomSeed RandomSeed `json:"random_seed"` Rates []int `json:"rates"` Durations []int `json:"durations"` VegetaArgs VegetaArgsShorthand `json:"vegeta_args"` Network string `json:"network"` }
type TxBuilder ¶
type TxBuilder interface { // Estimates the base runtime transaction gas limit EstimateGasForBaseTx() (*big.Int, error) // Returns the value of each cycle transaction, if any GetValue() *big.Int // Constructs the specific runtime transactions ConstructTransactions(accounts []*SenderAccount, numTxs int) ([]*types.Transaction, error) // Initializes the runtime Initialize() error }
type VegetaArgs ¶
type VegetaArgs interface{} // Can be string or nil
type VegetaArgsShorthand ¶
type VegetaArgsShorthand interface{} // Can be VegetaArgs or MultiVegetaArgs
type VegetaAttack ¶
type VegetaAttack struct { Rate int `json:"rate"` Duration int `json:"duration"` Calls []*JsonrpcMessage `json:"calls"` VegetaArgs *string `json:"vegeta_args"` // Can be string or nil }
func CreateLoadTest ¶
func CreateLoadTest(calls []*JsonrpcMessage, rates []int, durations []int, vegetaArgs interface{}, repeatCalls bool) ([]VegetaAttack, error)
CreateLoadTest creates a load test configuration
Click to show internal directories.
Click to hide internal directories.