Documentation ¶
Index ¶
- Constants
- Variables
- type ClientReport
- type Config
- type KubernetesRequestType
- type RecordingClient
- func (c *RecordingClient) Close() error
- func (c *RecordingClient) Defragment(ctx context.Context) error
- func (c *RecordingClient) Delete(ctx context.Context, key string) error
- func (c *RecordingClient) Get(ctx context.Context, key string) (*mvccpb.KeyValue, error)
- func (c *RecordingClient) LeaseGrant(ctx context.Context, ttl int64) (int64, error)
- func (c *RecordingClient) LeaseRevoke(ctx context.Context, leaseId int64) error
- func (c *RecordingClient) Put(ctx context.Context, key, value string) error
- func (c *RecordingClient) PutWithLease(ctx context.Context, key string, value string, leaseId int64) error
- func (c *RecordingClient) Range(ctx context.Context, key string, withPrefix bool) (*clientv3.GetResponse, error)
- func (c *RecordingClient) Report() ClientReport
- func (c *RecordingClient) Txn(ctx context.Context, conditions []clientv3.Cmp, onSuccess []clientv3.Op, ...) (*clientv3.TxnResponse, error)
- func (c *RecordingClient) Watch(ctx context.Context, key string, rev int64, withPrefix bool) clientv3.WatchChan
- type TimedWatchEvent
- type Traffic
- type WatchEvent
- type WatchResponse
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 (ClientReport) WatchEventCount ¶
func (r ClientReport) WatchEventCount() int
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 (*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) LeaseGrant ¶
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 (*RecordingClient) Range ¶
func (c *RecordingClient) Range(ctx context.Context, key string, withPrefix bool) (*clientv3.GetResponse, error)
func (*RecordingClient) Report ¶
func (c *RecordingClient) Report() ClientReport
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
Click to show internal directories.
Click to hide internal directories.