loadgen

package
v0.8.4 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2023 License: Apache-2.0, MIT Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateMH

func GenerateMH(nodeID uint64, entryNumber uint64) (multihash.Multihash, error)

func StartLoadGen

func StartLoadGen(ctx context.Context, loadConfig Config, loadGenOpts LoadGenOpts)

Types

type Config

type Config struct {
	AdsPerSec uint `json:"adsPerSec"`
	// A generator to specify how many entries per ad.
	// A function so the caller can define a distribution to follow.
	EntriesPerAdGenerator func() uint `json:"-"`
	// For json to be able to use a predefined distribution.
	EntriesPerAdType string `json:"entriesPerAdType"`
	EntriesPerChunk  uint   `json:"entriesPerChunk"`
	// Should this provider be an http provider?
	IsHttp         bool   `json:"isHttp"`
	HttpListenAddr string `json:"httpListenAddr"`
	// How many of the last N ads should be kept. 0 means every ad is kept.
	KeepNAds uint   `json:"keepNAds"`
	Seed     uint64 `json:"seed"`

	StopAfterNEntries uint64 `json:"stopAfterNEntries"`

	ListenMultiaddr string `json:"listenMultiaddr"`
	GossipSubTopic  string `json:"gossipSubTopic"`
}

func DefaultConfig

func DefaultConfig() Config

func LoadConfigFromFile

func LoadConfigFromFile(file string) (Config, error)

func (*Config) ParseEntriesPerAdGenerator

func (c *Config) ParseEntriesPerAdGenerator() bool

type LoadGenOpts

type LoadGenOpts struct {
	IndexerAddr            string
	ConcurrentProviders    uint
	ExternalAddressMapping map[string]string
	ListenForInterrupt     bool
}

Jump to

Keyboard shortcuts

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