Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotEnoughData = fmt.Errorf("not enough data") ErrWrongNumOfPeers = fmt.Errorf("expected bucket size number of peers") )
View Source
var ( MaxMeasurementAge = 2 * time.Hour MinMeasurementsThreshold = 5 MaxMeasurementsThreshold = 150 )
Functions ¶
Types ¶
type Estimator ¶
type Estimator struct {
// contains filtered or unexported fields
}
func NewEstimator ¶
func (*Estimator) NetworkSize ¶
NetworkSize instructs the Estimator to calculate the current network size estimate.
func (*Estimator) Track ¶
Track tracks the list of peers for the given key to incorporate in the next network size estimate. key is expected **NOT** to be in the kademlia keyspace and peers is expected to be a sorted list of the closest peers to the given key (the closest first). This function expects peers to have the same length as the routing table bucket size. It also strips old and limits the number of data points (favouring new).
Click to show internal directories.
Click to hide internal directories.