hammer

package
v0.1.2-alpha Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package hammer sends multiple requests to Key Transparency at the same time.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CallOptions

type CallOptions func(userID string) []grpc.CallOption

CallOptions returns PerRPCCredentials for the requested user.

type Config

type Config struct {
	TestTypes map[string]bool

	WriteQPS   int
	WriteCount int

	BatchWriteQPS   int
	BatchWriteCount int
	BatchWriteSize  int

	ReadQPS      int
	ReadCount    int
	ReadPageSize int

	HistoryQPS      int
	HistoryCount    int
	HistoryPageSize int

	Duration time.Duration
}

Config tells the hammer what operations to do and how fast to go.

type DialFunc

type DialFunc func(ctx context.Context, addr string, opts ...grpc.DialOption) (pb.KeyTransparencyClient, error)

DialFunc returns a connected grpc client for Key Transparency.

type Hammer

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

Hammer represents a single run of the hammer.

func New

func New(ctx context.Context, dial DialFunc, callOptions CallOptions,
	ktAddr, directoryID string, timeout time.Duration, keyset *tink.KeysetHandle) (*Hammer, error)

New returns a new hammer job

func (*Hammer) Run

func (h *Hammer) Run(ctx context.Context, numWorkers int, c Config) error

Run runs a total of operationCount operations across numWorkers. The number of workers should roughly be (goal QPS) * (timeout seconds).

type ReqHandler

type ReqHandler func(ctx context.Context, arg *reqArgs) error

ReqHandler executes a request.

Jump to

Keyboard shortcuts

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