hammer

package
Version: v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2020 License: Apache-2.0 Imports: 16 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) (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,
	directoryID string, timeout time.Duration, keyset *keyset.Handle) (*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.

Source Files

Jump to

Keyboard shortcuts

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