Documentation
¶
Overview ¶
Package pingpong provides a transaction generating utility for performance testing.
Index ¶
Constants ¶
const ConfigFilename = "ppconfig.json"
ConfigFilename name of configuration file
Variables ¶
var DefaultConfig = PpConfig{ SrcAccount: "", RandomizeFee: false, RandomizeAmt: false, RandomizeDst: false, MaxRandomDst: 200000, MaxFee: 10000, MinFee: 1000, MaxAmt: 1000, TxnPerSec: 200, NumPartAccounts: 10, RunTime: 10 * time.Second, RefreshTime: 3600 * time.Second, MinAccountFunds: 100000, GroupSize: 1, NumAsset: 0, MinAccountAsset: 10000000, NumApp: 0, NumBoxUpdate: 0, NumBoxRead: 0, AppProgOps: 0, AppProgHashes: 0, AppProgHashSize: "sha256", Rekey: false, MaxRuntime: 0, ProgramProbability: 1, NftAsaAccountInFlight: 5, NftAsaPerAccount: 900, }
DefaultConfig object for Ping Pong
Functions ¶
This section is empty.
Types ¶
type CreatablesInfo ¶
type CreatablesInfo struct { AssetParams map[uint64]model.AssetParams AppParams map[uint64]model.ApplicationParams OptIns map[uint64][]string }
CreatablesInfo has information about created assets, apps and opting in
type PpConfig ¶
type PpConfig struct { // SrcAccount is address to use as funding source for new accounts SrcAccount string RandomizeFee bool RandomizeAmt bool RandomizeDst bool MaxRandomDst uint64 MaxFee uint64 MinFee uint64 MaxAmt uint64 TxnPerSec uint64 NumPartAccounts uint32 RunTime time.Duration RefreshTime time.Duration MinAccountFunds uint64 Quiet bool RandomNote bool RandomLease bool TotalLatencyOut string Program []byte LogicArgs [][]byte ProgramProbability float64 GroupSize uint32 // NumAsset is the number of assets each account holds NumAsset uint32 // MinAccountAsset MinAccountAsset uint64 // NumApp is the total number of apps to create NumApp uint32 // NumAppOptIn is the number of apps each account opts in to NumAppOptIn uint32 // NumBoxUpdate is the number of boxes used per app, where box values are updated each call NumBoxUpdate uint32 // NumBoxRead is the number of boxes used per app, where box values are only read each call NumBoxRead uint32 AppProgOps uint32 AppProgHashes uint32 AppProgHashSize string AppGlobKeys uint32 AppLocalKeys uint32 Rekey bool MaxRuntime time.Duration AsyncSending bool // asset spam; make lots of NFT ASAs NftAsaPerSecond uint32 // e.g. 100 NftAsaPerAccount uint32 // 0..999 NftAsaAccountInFlight uint32 // configuration related to using bootstrapped ledgers built by netgoal // TODO: support generatedAssetsCount, generatedApplicationCount DeterministicKeys bool GeneratedAccountsCount uint64 GeneratedAccountSampleMethod string GeneratedAccountsOffset uint64 GeneratedAccountsMnemonics []string WeightPayment float64 WeightAsset float64 WeightApp float64 WeightNFTCreation float64 }
PpConfig defines configuration structure for
func LoadConfigFromFile ¶
LoadConfigFromFile reads and loads Ping Pong configuration
func (*PpConfig) SetDefaultWeights ¶
func (cfg *PpConfig) SetDefaultWeights()
SetDefaultWeights ensures a reasonable configuration of traffic generation weights. With no weights set, and old args about what mode to run, each activated traffic type gets a weight of 1. With no weights set and some activated traffic type other than payment, payment gets deactivated (zero weight) to maintain compatibility with prior behavior. WeightPayment must be explicitly set to add it to the mix if other modes are activated.
type WorkerState ¶
type WorkerState struct {
// contains filtered or unexported fields
}
WorkerState object holds a running pingpong worker
func NewPingpong ¶
func NewPingpong(cfg PpConfig) *WorkerState
NewPingpong creates a new pingpong WorkerState
func (*WorkerState) PrepareAccounts ¶
func (pps *WorkerState) PrepareAccounts(ac *libgoal.Client) (err error)
PrepareAccounts to set up accounts and asset accounts required for Ping Pong run
func (*WorkerState) RunPingPong ¶
func (pps *WorkerState) RunPingPong(ctx context.Context, ac *libgoal.Client)
RunPingPong starts ping pong process