cfg

package
v0.0.0-...-6206b6d Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bconfig

type Bconfig struct {
	T                    int     // total number of running time in seconds
	N                    int     // total number of requests
	K                    int     // key sapce
	W                    float64 // write ratio
	Throttle             int     // requests per second throttle, unused if 0
	Concurrency          int     // number of simulated clients
	Distribution         string  // distribution
	LinearizabilityCheck bool    // run linearizability checker at the end of benchmark
	OpenLoopWorker       bool    // whether the workers are open-loop
	MaxOutstanding       int     // number of outstanding operations per OpenLoopWorker
	OpenLoopThrottle     int     // interval between commands in open loop client

	// conflict distribution
	Conflicts int // percentage of conflicting keys
	Min       int // min key

	// normal distribution
	Mu    float64 // mu of normal distribution
	Sigma float64 // sigma of normal distribution
	Move  bool    // moving average (mu) of normal distribution
	Speed int     // moving speed in milliseconds intervals per key

	// zipfian distribution
	ZipfianS float64 // zipfian s parameter
	ZipfianV float64 // zipfian v parameter

	// exponential distribution
	Lambda float64 // rate parameter

	Size int // payload size
}

Bconfig holds all benchmark configuration

func DefaultBConfig

func DefaultBConfig() Bconfig

DefaultBConfig returns a default benchmark config

type Config

type Config struct {
	Addrs    map[idservice.ID]string // address for node communication
	AddrsStr map[string]string       `json:"address"` // address for node communication

	UseRetroLog bool `json:"use_retro_log"`

	Policy    string  `json:"policy"`    // leader change policy {consecutive, majority}
	Threshold float64 `json:"threshold"` // threshold for policy in WPaxos {N consecutive or time interval in ms}

	Thrifty        bool `json:"thrifty"`          // only send messages to a quorum
	BufferSize     int  `json:"buffer_size"`      // buffer size for maps
	ChanBufferSize int  `json:"chan_buffer_size"` // buffer size for channels
	MultiVersion   bool `json:"multiversion"`     // create multi-version database

	//Leadership
	EphemeralLeader bool `json:"ephemeral_leader"` // whether we have a stable leader

	//PigPaxos
	NumRelays         int  `json:"num_relays"`          // total number of rely nodes
	RegionsPeerGroups bool `json:"regions_peer_groups"` // use regions as peer groups
	FixedRelays       bool `json:"fixed_relays"`        // use static relay nodes that do not randomly change
	RelaySlack        int  `json:"relay_slack"`         // ignoring this many slowest nodes in each relay group
	StdPigTimeout     int  `json:"std_pig_timeout"`     // timeout in ms after which all non-collected responses are treated as failures
	UseSmallP2b       bool `json:"use_small_p2b"`       // use small p2b aggregated message that puts missing IDs instead of voted ids

	N   int         // total number of nodes
	Z   int         // total number of zones
	Npz map[int]int // nodes per zone

	Benchmark Bconfig `json:"benchmark"` // benchmark configuration
}

Config contains every system configuration

func GetConfig

func GetConfig() *Config

GetConfig returns global configuration

func MakeDefaultConfig

func MakeDefaultConfig() *Config

MakeDefaultConfig returns Config object with few default values only used by init() and master

func (*Config) IDs

func (c *Config) IDs() []idservice.ID

IDs returns all node ids

func (*Config) Load

func (c *Config) Load()

Load loads configuration from config file in JSON format

func (*Config) Save

func (c *Config) Save() error

Save saves configuration to file in JSON format

func (*Config) String

func (c *Config) String() string

String is implemented to print the config

Jump to

Keyboard shortcuts

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