benchlist

package
v1.0.4-hotfix Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2020 License: BSD-3-Clause Imports: 14 Imported by: 24

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Validators             validators.Manager
	Threshold              int
	MinimumFailingDuration time.Duration
	Duration               time.Duration
	MaxPortion             float64
	PeerSummaryEnabled     bool
}

Config defines the configuration for a benchlist

type Manager

type Manager interface {
	// RegisterQuery registers a sent query and returns whether the query is subject to benchlist
	RegisterQuery(ids.ID, ids.ShortID, uint32, constants.MsgType) bool
	// RegisterResponse registers the response to a query message
	RegisterResponse(ids.ID, ids.ShortID, uint32)
	// QueryFailed registers that a query did not receive a response within our synchrony bound
	QueryFailed(ids.ID, ids.ShortID, uint32)
	// RegisterChain registers a new chain with metrics under [namespac]
	RegisterChain(*snow.Context, string) error
}

Manager provides an interface for a benchlist to register whether queries have been successful or unsuccessful and place validators with consistently failing queries on a benchlist to prevent waiting up to the full network timeout for their responses.

func NewManager

func NewManager(config *Config) Manager

NewManager returns a manager for chain-specific query benchlisting

func NewNoBenchlist

func NewNoBenchlist() Manager

NewNoBenchlist returns an empty benchlist that will never stop any queries

type QueryBenchlist

type QueryBenchlist interface {
	// RegisterQuery registers a sent query and returns whether the query is subject to benchlist
	RegisterQuery(validatorID ids.ShortID, requestID uint32, msgType constants.MsgType) bool
	// RegisterResponse registers the response to a query message
	RegisterResponse(validatorID ids.ShortID, requstID uint32)
	// QueryFailed registers that a query did not receive a response within our synchrony bound
	QueryFailed(validatorID ids.ShortID, requestID uint32)
}

QueryBenchlist ...

func NewQueryBenchlist

func NewQueryBenchlist(
	validators validators.Set,
	ctx *snow.Context,
	threshold int,
	minimumFailingDuration,
	duration time.Duration,
	maxPortion float64,
	summaryEnabled bool,
	namespace string,
) (QueryBenchlist, error)

NewQueryBenchlist ...

Jump to

Keyboard shortcuts

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