traffic

package
v0.0.0-...-b45d6de Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	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 (
	LowTraffic = Config{
		Name: "LowTraffic",
		// contains filtered or unexported fields
	}
	HighTraffic = Config{
		Name: "HighTraffic",
		// contains filtered or unexported fields
	}
)
View Source
var (
	DefaultLeaseTTL   int64 = 7200
	RequestTimeout          = 40 * time.Millisecond
	WatchTimeout            = 400 * time.Millisecond
	MultiOpTxnOpCount       = 4
)
View Source
var (
	KubernetesTraffic = Config{
		Name: "Kubernetes",
		// contains filtered or unexported fields
	}
)

Functions

This section is empty.

Types

type ClientReport

type ClientReport struct {
	ClientId         int
	OperationHistory model.History
	Watch            []WatchResponse
}

func SimulateTraffic

func SimulateTraffic(ctx context.Context, t *testing.T, lg *zap.Logger, clus *e2e.EtcdProcessCluster, config Config, finish <-chan struct{}, baseTime time.Time, ids identity.Provider) []ClientReport

func (ClientReport) WatchEventCount

func (r ClientReport) WatchEventCount() int

type Config

type Config struct {
	Name string
	// contains filtered or unexported fields
}

type KubernetesRequestType

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

type RecordingClient

type RecordingClient struct {
	// contains filtered or unexported fields
}

RecordingClient provides a semi etcd client (different interface than clientv3.Client) that records all the requests and responses made. Doesn't allow for concurrent requests to confirm to model.AppendableHistory requirements.

func NewClient

func NewClient(endpoints []string, ids identity.Provider, baseTime time.Time) (*RecordingClient, error)

func (*RecordingClient) Close

func (c *RecordingClient) Close() error

func (*RecordingClient) Defragment

func (c *RecordingClient) Defragment(ctx context.Context) error

func (*RecordingClient) Delete

func (c *RecordingClient) Delete(ctx context.Context, key string) error

func (*RecordingClient) Get

func (c *RecordingClient) Get(ctx context.Context, key string) (*mvccpb.KeyValue, error)

func (*RecordingClient) LeaseGrant

func (c *RecordingClient) LeaseGrant(ctx context.Context, ttl int64) (int64, error)

func (*RecordingClient) LeaseRevoke

func (c *RecordingClient) LeaseRevoke(ctx context.Context, leaseId int64) error

func (*RecordingClient) Put

func (c *RecordingClient) Put(ctx context.Context, key, value string) error

func (*RecordingClient) PutWithLease

func (c *RecordingClient) PutWithLease(ctx context.Context, key string, value string, leaseId int64) error

func (*RecordingClient) Range

func (c *RecordingClient) Range(ctx context.Context, key string, withPrefix bool) (*clientv3.GetResponse, error)

func (*RecordingClient) Report

func (c *RecordingClient) Report() ClientReport

func (*RecordingClient) Txn

func (c *RecordingClient) Txn(ctx context.Context, conditions []clientv3.Cmp, onSuccess []clientv3.Op, onFailure []clientv3.Op) (*clientv3.TxnResponse, error)

func (*RecordingClient) Watch

func (c *RecordingClient) Watch(ctx context.Context, key string, rev int64, withPrefix bool) clientv3.WatchChan

type TimedWatchEvent

type TimedWatchEvent struct {
	WatchEvent
	Time time.Duration
}

type Traffic

type Traffic interface {
	Run(ctx context.Context, c *RecordingClient, limiter *rate.Limiter, ids identity.Provider, lm identity.LeaseIdStorage, finish <-chan struct{})
}

type WatchEvent

type WatchEvent struct {
	Op       model.EtcdOperation
	Revision int64
}

type WatchResponse

type WatchResponse struct {
	Events           []WatchEvent
	IsProgressNotify bool
	Revision         int64
	Time             time.Duration
}

func ToWatchResponse

func ToWatchResponse(r clientv3.WatchResponse, baseTime time.Time) WatchResponse

Jump to

Keyboard shortcuts

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