Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Benchlist ¶ added in v1.2.1
type Benchlist interface { // RegisterResponse registers the response to a query message RegisterResponse(validatorID ids.ShortID) // RegisterFailure registers that we didn't receive a response within the timeout RegisterFailure(validatorID ids.ShortID) // IsBenched returns true if messages to [validatorID] // should not be sent over the network and should immediately fail. IsBenched(validatorID ids.ShortID) bool }
Benchlist ...
func NewBenchlist ¶ added in v1.2.1
func NewBenchlist( log logging.Logger, validators validators.Set, threshold int, minimumFailingDuration, duration time.Duration, maxPortion float64, namespace string, registerer prometheus.Registerer, ) (Benchlist, error)
NewBenchlist returns a new Benchlist
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 { // RegisterResponse registers that we receive a request response from [validatorID] // regarding [chainID] within the timeout RegisterResponse(chainID ids.ID, validatorID ids.ShortID) // RegisterFailure registers that a request to [validatorID] regarding // [chainID] timed out RegisterFailure(chainID ids.ID, validatorID ids.ShortID) // RegisterChain registers a new chain with metrics under [namespace] RegisterChain(ctx *snow.Context, namespace string) error // IsBenched returns true if messages to [validatorID] regarding chain [chainID] // should not be sent over the network and should immediately fail. // Returns false if such messages should be sent, or if the chain is unknown. IsBenched(validatorID ids.ShortID, chainID ids.ID) bool // GetBenched returns an array of chainIDs where the specified // [validatorID] is benched. If called on an id.ShortID that does // not map to a validator, it will return an empty array. GetBenched(validatorID ids.ShortID) []ids.ID }
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 ¶
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
Click to show internal directories.
Click to hide internal directories.