benchmark

package
v1.6.20 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2022 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthBenchmark        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowBenchmark          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupBenchmark = fmt.Errorf("proto: unexpected end of group")
)

Functions

func Main

func Main()

Main runs a test

func Register

func Register(name string, suite BenchmarkingSuite)

Register registers a benchmark suite Deprecated: Use registry.RegisterBenchmarkSuite instead

func RegisterWorkerServiceServer

func RegisterWorkerServiceServer(s *grpc.Server, srv WorkerServiceServer)

func Run

func Run(config *Config) error

Run runs the benchmark

Types

type Benchmark

type Benchmark struct {
	*input.Context
	// contains filtered or unexported fields
}

Benchmark is a benchmark runner

type BenchmarkRequest

type BenchmarkRequest struct {
	// suite is the benchmark suite
	Suite string `protobuf:"bytes,1,opt,name=suite,proto3" json:"suite,omitempty"`
	// benchmark is the benchmark to run
	Benchmark string `protobuf:"bytes,2,opt,name=benchmark,proto3" json:"benchmark,omitempty"`
	// args is the benchmark arguments
	Args map[string]string `` /* 149-byte string literal not displayed */
}

BenchmarkRequest is a benchmark request

func (*BenchmarkRequest) Descriptor

func (*BenchmarkRequest) Descriptor() ([]byte, []int)

func (*BenchmarkRequest) GetArgs

func (m *BenchmarkRequest) GetArgs() map[string]string

func (*BenchmarkRequest) GetBenchmark

func (m *BenchmarkRequest) GetBenchmark() string

func (*BenchmarkRequest) GetSuite

func (m *BenchmarkRequest) GetSuite() string

func (*BenchmarkRequest) Marshal

func (m *BenchmarkRequest) Marshal() (dAtA []byte, err error)

func (*BenchmarkRequest) MarshalTo

func (m *BenchmarkRequest) MarshalTo(dAtA []byte) (int, error)

func (*BenchmarkRequest) MarshalToSizedBuffer

func (m *BenchmarkRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*BenchmarkRequest) ProtoMessage

func (*BenchmarkRequest) ProtoMessage()

func (*BenchmarkRequest) Reset

func (m *BenchmarkRequest) Reset()

func (*BenchmarkRequest) Size

func (m *BenchmarkRequest) Size() (n int)

func (*BenchmarkRequest) String

func (m *BenchmarkRequest) String() string

func (*BenchmarkRequest) Unmarshal

func (m *BenchmarkRequest) Unmarshal(dAtA []byte) error

func (*BenchmarkRequest) XXX_DiscardUnknown

func (m *BenchmarkRequest) XXX_DiscardUnknown()

func (*BenchmarkRequest) XXX_Marshal

func (m *BenchmarkRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*BenchmarkRequest) XXX_Merge

func (m *BenchmarkRequest) XXX_Merge(src proto.Message)

func (*BenchmarkRequest) XXX_Size

func (m *BenchmarkRequest) XXX_Size() int

func (*BenchmarkRequest) XXX_Unmarshal

func (m *BenchmarkRequest) XXX_Unmarshal(b []byte) error

type BenchmarkResponse

type BenchmarkResponse struct {
}

BenchmarkResponse is a benchmark response

func (*BenchmarkResponse) Descriptor

func (*BenchmarkResponse) Descriptor() ([]byte, []int)

func (*BenchmarkResponse) Marshal

func (m *BenchmarkResponse) Marshal() (dAtA []byte, err error)

func (*BenchmarkResponse) MarshalTo

func (m *BenchmarkResponse) MarshalTo(dAtA []byte) (int, error)

func (*BenchmarkResponse) MarshalToSizedBuffer

func (m *BenchmarkResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*BenchmarkResponse) ProtoMessage

func (*BenchmarkResponse) ProtoMessage()

func (*BenchmarkResponse) Reset

func (m *BenchmarkResponse) Reset()

func (*BenchmarkResponse) Size

func (m *BenchmarkResponse) Size() (n int)

func (*BenchmarkResponse) String

func (m *BenchmarkResponse) String() string

func (*BenchmarkResponse) Unmarshal

func (m *BenchmarkResponse) Unmarshal(dAtA []byte) error

func (*BenchmarkResponse) XXX_DiscardUnknown

func (m *BenchmarkResponse) XXX_DiscardUnknown()

func (*BenchmarkResponse) XXX_Marshal

func (m *BenchmarkResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*BenchmarkResponse) XXX_Merge

func (m *BenchmarkResponse) XXX_Merge(src proto.Message)

func (*BenchmarkResponse) XXX_Size

func (m *BenchmarkResponse) XXX_Size() int

func (*BenchmarkResponse) XXX_Unmarshal

func (m *BenchmarkResponse) XXX_Unmarshal(b []byte) error

type BenchmarkingSuite

type BenchmarkingSuite interface{}

BenchmarkingSuite is a suite of benchmarks

type Config

type Config struct {
	*job.Config `json:",inline"`
	Suite       string            `json:"suite,omitempty"`
	Benchmark   string            `json:"benchmark,omitempty"`
	Workers     int               `json:"workers,omitempty"`
	Parallelism int               `json:"parallelism,omitempty"`
	Iterations  int               `json:"iterations,omitempty"`
	Duration    *time.Duration    `json:"duration,omitempty"`
	Args        map[string]string `json:"args,omitempty"`
	MaxLatency  *time.Duration    `json:"maxLatency,omitempty"`
	NoTeardown  bool              `json:"verbose,omitempty"`
}

Config is a benchmark configuration

type Coordinator

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

Coordinator coordinates workers for suites of benchmarks

func (*Coordinator) Run

func (c *Coordinator) Run() (int, error)

Run runs the tests

type RunRequest

type RunRequest struct {
	// suite is the benchmark suite
	Suite string `protobuf:"bytes,1,opt,name=suite,proto3" json:"suite,omitempty"`
	// benchmark is the benchmark to run
	Benchmark string `protobuf:"bytes,2,opt,name=benchmark,proto3" json:"benchmark,omitempty"`
	// requests is the number of requests to run
	Requests uint32 `protobuf:"varint,3,opt,name=requests,proto3" json:"requests,omitempty"`
	// duration is the duration for which to run the benchmark
	Duration *time.Duration `protobuf:"bytes,4,opt,name=duration,proto3,stdduration" json:"duration,omitempty"`
	// parallelism is the benchmark parallelism
	Parallelism uint32 `protobuf:"varint,5,opt,name=parallelism,proto3" json:"parallelism,omitempty"`
	// args is the benchmark arguments
	Args map[string]string `` /* 149-byte string literal not displayed */
	// maximum allowed latency before the benchmark will fail
	MaxLatency *time.Duration `protobuf:"bytes,7,opt,name=maxLatency,proto3,stdduration" json:"maxLatency,omitempty"`
}

RunRequest is a benchmark run request

func (*RunRequest) Descriptor

func (*RunRequest) Descriptor() ([]byte, []int)

func (*RunRequest) GetArgs

func (m *RunRequest) GetArgs() map[string]string

func (*RunRequest) GetBenchmark

func (m *RunRequest) GetBenchmark() string

func (*RunRequest) GetDuration

func (m *RunRequest) GetDuration() *time.Duration

func (*RunRequest) GetMaxLatency

func (m *RunRequest) GetMaxLatency() *time.Duration

func (*RunRequest) GetParallelism

func (m *RunRequest) GetParallelism() uint32

func (*RunRequest) GetRequests

func (m *RunRequest) GetRequests() uint32

func (*RunRequest) GetSuite

func (m *RunRequest) GetSuite() string

func (*RunRequest) Marshal

func (m *RunRequest) Marshal() (dAtA []byte, err error)

func (*RunRequest) MarshalTo

func (m *RunRequest) MarshalTo(dAtA []byte) (int, error)

func (*RunRequest) MarshalToSizedBuffer

func (m *RunRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*RunRequest) ProtoMessage

func (*RunRequest) ProtoMessage()

func (*RunRequest) Reset

func (m *RunRequest) Reset()

func (*RunRequest) Size

func (m *RunRequest) Size() (n int)

func (*RunRequest) String

func (m *RunRequest) String() string

func (*RunRequest) Unmarshal

func (m *RunRequest) Unmarshal(dAtA []byte) error

func (*RunRequest) XXX_DiscardUnknown

func (m *RunRequest) XXX_DiscardUnknown()

func (*RunRequest) XXX_Marshal

func (m *RunRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RunRequest) XXX_Merge

func (m *RunRequest) XXX_Merge(src proto.Message)

func (*RunRequest) XXX_Size

func (m *RunRequest) XXX_Size() int

func (*RunRequest) XXX_Unmarshal

func (m *RunRequest) XXX_Unmarshal(b []byte) error

type RunResponse

type RunResponse struct {
	// suite is the benchmark suite
	Suite string `protobuf:"bytes,1,opt,name=suite,proto3" json:"suite,omitempty"`
	// benchmark is the benchmark that was run
	Benchmark string `protobuf:"bytes,2,opt,name=benchmark,proto3" json:"benchmark,omitempty"`
	// requests is the number of requests that were run
	Requests uint32 `protobuf:"varint,3,opt,name=requests,proto3" json:"requests,omitempty"`
	// duration is the duration of the test run
	Duration time.Duration `protobuf:"bytes,4,opt,name=duration,proto3,stdduration" json:"duration"`
	// latency is the mean latency
	Latency time.Duration `protobuf:"bytes,5,opt,name=latency,proto3,stdduration" json:"latency"`
	// latency* are latency percentiles
	Latency50 time.Duration `protobuf:"bytes,6,opt,name=latency50,proto3,stdduration" json:"latency50"`
	Latency75 time.Duration `protobuf:"bytes,7,opt,name=latency75,proto3,stdduration" json:"latency75"`
	Latency95 time.Duration `protobuf:"bytes,8,opt,name=latency95,proto3,stdduration" json:"latency95"`
	Latency99 time.Duration `protobuf:"bytes,9,opt,name=latency99,proto3,stdduration" json:"latency99"`
}

RunResponse is a benchmark run response

func (*RunResponse) Descriptor

func (*RunResponse) Descriptor() ([]byte, []int)

func (*RunResponse) GetBenchmark

func (m *RunResponse) GetBenchmark() string

func (*RunResponse) GetDuration

func (m *RunResponse) GetDuration() time.Duration

func (*RunResponse) GetLatency

func (m *RunResponse) GetLatency() time.Duration

func (*RunResponse) GetLatency50

func (m *RunResponse) GetLatency50() time.Duration

func (*RunResponse) GetLatency75

func (m *RunResponse) GetLatency75() time.Duration

func (*RunResponse) GetLatency95

func (m *RunResponse) GetLatency95() time.Duration

func (*RunResponse) GetLatency99

func (m *RunResponse) GetLatency99() time.Duration

func (*RunResponse) GetRequests

func (m *RunResponse) GetRequests() uint32

func (*RunResponse) GetSuite

func (m *RunResponse) GetSuite() string

func (*RunResponse) Marshal

func (m *RunResponse) Marshal() (dAtA []byte, err error)

func (*RunResponse) MarshalTo

func (m *RunResponse) MarshalTo(dAtA []byte) (int, error)

func (*RunResponse) MarshalToSizedBuffer

func (m *RunResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*RunResponse) ProtoMessage

func (*RunResponse) ProtoMessage()

func (*RunResponse) Reset

func (m *RunResponse) Reset()

func (*RunResponse) Size

func (m *RunResponse) Size() (n int)

func (*RunResponse) String

func (m *RunResponse) String() string

func (*RunResponse) Unmarshal

func (m *RunResponse) Unmarshal(dAtA []byte) error

func (*RunResponse) XXX_DiscardUnknown

func (m *RunResponse) XXX_DiscardUnknown()

func (*RunResponse) XXX_Marshal

func (m *RunResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RunResponse) XXX_Merge

func (m *RunResponse) XXX_Merge(src proto.Message)

func (*RunResponse) XXX_Size

func (m *RunResponse) XXX_Size() int

func (*RunResponse) XXX_Unmarshal

func (m *RunResponse) XXX_Unmarshal(b []byte) error

type SetupBenchmark

type SetupBenchmark interface {
	SetupBenchmark(c *input.Context) error
}

SetupBenchmark is an interface for executing code before every benchmark

type SetupSuite

type SetupSuite interface {
	SetupSuite(c *input.Context) error
}

SetupSuite is an interface for setting up a suite of benchmarks

type SetupWorker

type SetupWorker interface {
	SetupWorker(c *input.Context) error
}

SetupWorker is an interface for setting up individual benchmarks

type Suite

type Suite struct{}

Suite is an identifier interface for benchmark suites

type SuiteRequest

type SuiteRequest struct {
	// suite is the benchmark suite
	Suite string `protobuf:"bytes,1,opt,name=suite,proto3" json:"suite,omitempty"`
	// args is the benchmark arguments
	Args map[string]string `` /* 149-byte string literal not displayed */
}

SuiteRequest is a benchmark suite request

func (*SuiteRequest) Descriptor

func (*SuiteRequest) Descriptor() ([]byte, []int)

func (*SuiteRequest) GetArgs

func (m *SuiteRequest) GetArgs() map[string]string

func (*SuiteRequest) GetSuite

func (m *SuiteRequest) GetSuite() string

func (*SuiteRequest) Marshal

func (m *SuiteRequest) Marshal() (dAtA []byte, err error)

func (*SuiteRequest) MarshalTo

func (m *SuiteRequest) MarshalTo(dAtA []byte) (int, error)

func (*SuiteRequest) MarshalToSizedBuffer

func (m *SuiteRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*SuiteRequest) ProtoMessage

func (*SuiteRequest) ProtoMessage()

func (*SuiteRequest) Reset

func (m *SuiteRequest) Reset()

func (*SuiteRequest) Size

func (m *SuiteRequest) Size() (n int)

func (*SuiteRequest) String

func (m *SuiteRequest) String() string

func (*SuiteRequest) Unmarshal

func (m *SuiteRequest) Unmarshal(dAtA []byte) error

func (*SuiteRequest) XXX_DiscardUnknown

func (m *SuiteRequest) XXX_DiscardUnknown()

func (*SuiteRequest) XXX_Marshal

func (m *SuiteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SuiteRequest) XXX_Merge

func (m *SuiteRequest) XXX_Merge(src proto.Message)

func (*SuiteRequest) XXX_Size

func (m *SuiteRequest) XXX_Size() int

func (*SuiteRequest) XXX_Unmarshal

func (m *SuiteRequest) XXX_Unmarshal(b []byte) error

type SuiteResponse

type SuiteResponse struct {
}

SuiteResponse is a response to a SuiteRequest

func (*SuiteResponse) Descriptor

func (*SuiteResponse) Descriptor() ([]byte, []int)

func (*SuiteResponse) Marshal

func (m *SuiteResponse) Marshal() (dAtA []byte, err error)

func (*SuiteResponse) MarshalTo

func (m *SuiteResponse) MarshalTo(dAtA []byte) (int, error)

func (*SuiteResponse) MarshalToSizedBuffer

func (m *SuiteResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*SuiteResponse) ProtoMessage

func (*SuiteResponse) ProtoMessage()

func (*SuiteResponse) Reset

func (m *SuiteResponse) Reset()

func (*SuiteResponse) Size

func (m *SuiteResponse) Size() (n int)

func (*SuiteResponse) String

func (m *SuiteResponse) String() string

func (*SuiteResponse) Unmarshal

func (m *SuiteResponse) Unmarshal(dAtA []byte) error

func (*SuiteResponse) XXX_DiscardUnknown

func (m *SuiteResponse) XXX_DiscardUnknown()

func (*SuiteResponse) XXX_Marshal

func (m *SuiteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SuiteResponse) XXX_Merge

func (m *SuiteResponse) XXX_Merge(src proto.Message)

func (*SuiteResponse) XXX_Size

func (m *SuiteResponse) XXX_Size() int

func (*SuiteResponse) XXX_Unmarshal

func (m *SuiteResponse) XXX_Unmarshal(b []byte) error

type TearDownBenchmark

type TearDownBenchmark interface {
	TearDownBenchmark(c *input.Context) error
}

TearDownBenchmark is an interface for executing code after every benchmark

type TearDownSuite

type TearDownSuite interface {
	TearDownSuite(c *input.Context) error
}

TearDownSuite is an interface for tearing down a suite of benchmarks

type TearDownWorker

type TearDownWorker interface {
	TearDownWorker(c *input.Context) error
}

TearDownWorker is an interface for tearing down individual benchmarks

type UnimplementedWorkerServiceServer

type UnimplementedWorkerServiceServer struct {
}

UnimplementedWorkerServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedWorkerServiceServer) RunBenchmark

func (*UnimplementedWorkerServiceServer) SetupBenchmark

func (*UnimplementedWorkerServiceServer) SetupSuite

func (*UnimplementedWorkerServiceServer) SetupWorker

func (*UnimplementedWorkerServiceServer) TearDownBenchmark

func (*UnimplementedWorkerServiceServer) TearDownSuite

func (*UnimplementedWorkerServiceServer) TearDownWorker

type Worker

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

Worker runs a benchmark job

func (*Worker) Run

func (w *Worker) Run() error

Run runs a benchmark

func (*Worker) RunBenchmark

func (w *Worker) RunBenchmark(ctx context.Context, request *RunRequest) (*RunResponse, error)

RunBenchmark runs a benchmark

func (*Worker) SetupBenchmark

func (w *Worker) SetupBenchmark(ctx context.Context, request *BenchmarkRequest) (*BenchmarkResponse, error)

SetupBenchmark sets up a benchmark

func (*Worker) SetupSuite

func (w *Worker) SetupSuite(ctx context.Context, request *SuiteRequest) (*SuiteResponse, error)

SetupSuite sets up a benchmark suite

func (*Worker) SetupWorker

func (w *Worker) SetupWorker(ctx context.Context, request *SuiteRequest) (*SuiteResponse, error)

SetupWorker sets up a benchmark worker

func (*Worker) TearDownBenchmark

func (w *Worker) TearDownBenchmark(ctx context.Context, request *BenchmarkRequest) (*BenchmarkResponse, error)

TearDownBenchmark tears down a benchmark

func (*Worker) TearDownSuite

func (w *Worker) TearDownSuite(ctx context.Context, request *SuiteRequest) (*SuiteResponse, error)

TearDownSuite tears down a benchmark suite

func (*Worker) TearDownWorker

func (w *Worker) TearDownWorker(ctx context.Context, request *SuiteRequest) (*SuiteResponse, error)

TearDownWorker tears down a benchmark worker

type WorkerServiceClient

type WorkerServiceClient interface {
	SetupSuite(ctx context.Context, in *SuiteRequest, opts ...grpc.CallOption) (*SuiteResponse, error)
	TearDownSuite(ctx context.Context, in *SuiteRequest, opts ...grpc.CallOption) (*SuiteResponse, error)
	SetupWorker(ctx context.Context, in *SuiteRequest, opts ...grpc.CallOption) (*SuiteResponse, error)
	TearDownWorker(ctx context.Context, in *SuiteRequest, opts ...grpc.CallOption) (*SuiteResponse, error)
	SetupBenchmark(ctx context.Context, in *BenchmarkRequest, opts ...grpc.CallOption) (*BenchmarkResponse, error)
	TearDownBenchmark(ctx context.Context, in *BenchmarkRequest, opts ...grpc.CallOption) (*BenchmarkResponse, error)
	RunBenchmark(ctx context.Context, in *RunRequest, opts ...grpc.CallOption) (*RunResponse, error)
}

WorkerServiceClient is the client API for WorkerService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewWorkerServiceClient

func NewWorkerServiceClient(cc *grpc.ClientConn) WorkerServiceClient

type WorkerServiceServer

type WorkerServiceServer interface {
	SetupSuite(context.Context, *SuiteRequest) (*SuiteResponse, error)
	TearDownSuite(context.Context, *SuiteRequest) (*SuiteResponse, error)
	SetupWorker(context.Context, *SuiteRequest) (*SuiteResponse, error)
	TearDownWorker(context.Context, *SuiteRequest) (*SuiteResponse, error)
	SetupBenchmark(context.Context, *BenchmarkRequest) (*BenchmarkResponse, error)
	TearDownBenchmark(context.Context, *BenchmarkRequest) (*BenchmarkResponse, error)
	RunBenchmark(context.Context, *RunRequest) (*RunResponse, error)
}

WorkerServiceServer is the server API for WorkerService service.

type WorkerTask

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

WorkerTask manages a single test job for a test worker

func (*WorkerTask) Run

func (t *WorkerTask) Run() (int, error)

Run runs the worker job

Jump to

Keyboard shortcuts

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