bitswap

package
v0.0.0-...-ce94876 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2019 License: MIT, MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InternetLatencyDelayGenerator

func InternetLatencyDelayGenerator(
	mediumDelay time.Duration,
	largeDelay time.Duration,
	percentMedium float64,
	percentLarge float64,
	std time.Duration,
	rng *rand.Rand) delay.Generator

InternetLatencyDelayGenerator generates three clusters of delays, typical of the type of peers you would encounter on the interenet Given a base delay time T, the wait time generated will be either: 1. A normalized distribution around the base time 2. A normalized distribution around the base time plus a "medium" delay 3. A normalized distribution around the base time plus a "large" delay The size of the medium & large delays are determined when the generator is constructed, as well as the relative percentages with which delays fall into each of the three different clusters, and the standard deviation for the normalized distribution This can be used to generate a number of scenarios typical of latency distribution among peers on the internet

Types

type Network

type Network interface {
	Adapter(testutil.Identity) bsnet.BitSwapNetwork

	HasPeer(peer.ID) bool
}

func StreamNet

func StreamNet(ctx context.Context, net mockpeernet.Mocknet, rs mockrouting.Server) (Network, error)

func VirtualNetwork

func VirtualNetwork(rs mockrouting.Server, d delay.D) Network

Jump to

Keyboard shortcuts

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