traffic

package
v3.6.0-alpha.0....-b197332 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2025 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Get           etcdRequestType = "get"
	StaleGet      etcdRequestType = "staleGet"
	List          etcdRequestType = "list"
	StaleList     etcdRequestType = "staleList"
	Put           etcdRequestType = "put"
	LargePut      etcdRequestType = "largePut"
	Delete        etcdRequestType = "delete"
	MultiOpTxn    etcdRequestType = "multiOpTxn"
	PutWithLease  etcdRequestType = "putWithLease"
	LeaseRevoke   etcdRequestType = "leaseRevoke"
	CompareAndSet etcdRequestType = "compareAndSet"
	Defragment    etcdRequestType = "defragment"
)

Variables

View Source
var (
	DefaultLeaseTTL         int64 = 7200
	RequestTimeout                = 200 * time.Millisecond
	WatchTimeout                  = time.Second
	MultiOpTxnOpCount             = 4
	DefaultCompactionPeriod       = 200 * time.Millisecond

	LowTraffic = Profile{
		MinimalQPS:                     100,
		MaximalQPS:                     200,
		ClientCount:                    8,
		MaxNonUniqueRequestConcurrency: 3,
	}
	HighTrafficProfile = Profile{
		MinimalQPS:                     100,
		MaximalQPS:                     1000,
		ClientCount:                    8,
		MaxNonUniqueRequestConcurrency: 3,
	}
)

Functions

func SimulateTraffic

func SimulateTraffic(ctx context.Context, t *testing.T, lg *zap.Logger, clus *e2e.EtcdProcessCluster, profile Profile, traffic Traffic, failpointInjected <-chan report.FailpointInjection, baseTime time.Time, ids identity.Provider) []report.ClientReport

Types

type ConcurrencyLimiter

type ConcurrencyLimiter interface {
	Take() bool
	Return()
}

func NewConcurrencyLimiter

func NewConcurrencyLimiter(size int) ConcurrencyLimiter

type KubernetesRequestType

type KubernetesRequestType string
const (
	KubernetesDelete KubernetesRequestType = "delete"
	KubernetesUpdate KubernetesRequestType = "update"
	KubernetesCreate KubernetesRequestType = "create"
)

type Profile

type Profile struct {
	MinimalQPS                     float64
	MaximalQPS                     float64
	MaxNonUniqueRequestConcurrency int
	ClientCount                    int
	ForbidCompaction               bool
	CompactPeriod                  time.Duration
}

func (Profile) WithCompactionPeriod

func (p Profile) WithCompactionPeriod(cp time.Duration) Profile

func (Profile) WithoutCompaction

func (p Profile) WithoutCompaction() Profile

type Traffic

type Traffic interface {
	RunTrafficLoop(ctx context.Context, c *client.RecordingClient, qpsLimiter *rate.Limiter, ids identity.Provider, lm identity.LeaseIDStorage, nonUniqueWriteLimiter ConcurrencyLimiter, finish <-chan struct{})
	RunCompactLoop(ctx context.Context, c *client.RecordingClient, period time.Duration, finish <-chan struct{})
	ExpectUniqueRevision() bool
}
var (
	EtcdPutDeleteLease Traffic = etcdTraffic{
						// contains filtered or unexported fields
	}
	EtcdPut Traffic = etcdTraffic{
			// contains filtered or unexported fields
	}
	EtcdDelete Traffic = etcdTraffic{
				// contains filtered or unexported fields
	}
)
var Kubernetes Traffic = kubernetesTraffic{
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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