benchmark

package module
v0.2.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

README

cosmossdk.io/tools/benchmark

A benchmark module to test chain and storage performance. It can be used to holistically test the end to end performance of a node. Given an initial configuration tools/benchmark provides:

  • A possibly enormous sequence of key-value sets in InitGenesis distributed across n storekeys, e.g. 20M keys across 5 store keys
  • A client which syncs to genesis state then deterministically generates txs which contain a configurable sequence of get, insert, update & delete operations
  • A keeper which processes the above transactions and emits some telemetry data about them.

Client invocation looks like:

simdv2 tx benchmark load-test --from bob --yes --ops 1000 --pause 10 -v

On exit it dumps the generator state so that running again should still be in sync. It assumes that any transaction accepted by the network was processed, which may not be the case, so miss rate will probably increase over time. This isn't really a problem for tests.

Obviously this module is built to DOS a node by testing the upper bounds of chain performance; when testing gas limits should be increased. It should not be included in chains by default but is enabled in simapp for testing.

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")
)
View Source
var (
	ErrInvalidLengthTx        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTx          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group")
)
View Source
var Msg_serviceDesc = _Msg_serviceDesc

Functions

func RegisterMsgServer

func RegisterMsgServer(s grpc1.Server, srv MsgServer)

Types

type MsgClient

type MsgClient interface {
	// LoadTest defines a method for executing a sequence of load test operations.
	LoadTest(ctx context.Context, in *MsgLoadTest, opts ...grpc.CallOption) (*MsgLoadTestResponse, error)
}

MsgClient is the client API for Msg service.

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

func NewMsgClient

func NewMsgClient(cc grpc1.ClientConn) MsgClient

type MsgLoadTest

type MsgLoadTest struct {
	Caller []byte `protobuf:"bytes,1,opt,name=caller,proto3" json:"caller,omitempty"`
	Ops    []*Op  `protobuf:"bytes,2,rep,name=ops,proto3" json:"ops,omitempty"`
}

MsgLoadTestOps defines a message containing a sequence of load test operations.

func (*MsgLoadTest) Descriptor

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

func (*MsgLoadTest) GetCaller

func (m *MsgLoadTest) GetCaller() []byte

func (*MsgLoadTest) GetOps

func (m *MsgLoadTest) GetOps() []*Op

func (*MsgLoadTest) Marshal

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

func (*MsgLoadTest) MarshalTo

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

func (*MsgLoadTest) MarshalToSizedBuffer

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

func (*MsgLoadTest) ProtoMessage

func (*MsgLoadTest) ProtoMessage()

func (*MsgLoadTest) Reset

func (m *MsgLoadTest) Reset()

func (*MsgLoadTest) Size

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

func (*MsgLoadTest) String

func (m *MsgLoadTest) String() string

func (*MsgLoadTest) Unmarshal

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

func (*MsgLoadTest) XXX_DiscardUnknown

func (m *MsgLoadTest) XXX_DiscardUnknown()

func (*MsgLoadTest) XXX_Marshal

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

func (*MsgLoadTest) XXX_Merge

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

func (*MsgLoadTest) XXX_Size

func (m *MsgLoadTest) XXX_Size() int

func (*MsgLoadTest) XXX_Unmarshal

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

type MsgLoadTestResponse

type MsgLoadTestResponse struct {
	TotalTime   uint64 `protobuf:"varint,1,opt,name=total_time,json=totalTime,proto3" json:"total_time,omitempty"`
	TotalErrors uint64 `protobuf:"varint,2,opt,name=total_errors,json=totalErrors,proto3" json:"total_errors,omitempty"`
}

MsgLoadTestResponse defines a message containing the results of a load test operation.

func (*MsgLoadTestResponse) Descriptor

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

func (*MsgLoadTestResponse) GetTotalErrors

func (m *MsgLoadTestResponse) GetTotalErrors() uint64

func (*MsgLoadTestResponse) GetTotalTime

func (m *MsgLoadTestResponse) GetTotalTime() uint64

func (*MsgLoadTestResponse) Marshal

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

func (*MsgLoadTestResponse) MarshalTo

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

func (*MsgLoadTestResponse) MarshalToSizedBuffer

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

func (*MsgLoadTestResponse) ProtoMessage

func (*MsgLoadTestResponse) ProtoMessage()

func (*MsgLoadTestResponse) Reset

func (m *MsgLoadTestResponse) Reset()

func (*MsgLoadTestResponse) Size

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

func (*MsgLoadTestResponse) String

func (m *MsgLoadTestResponse) String() string

func (*MsgLoadTestResponse) Unmarshal

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

func (*MsgLoadTestResponse) XXX_DiscardUnknown

func (m *MsgLoadTestResponse) XXX_DiscardUnknown()

func (*MsgLoadTestResponse) XXX_Marshal

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

func (*MsgLoadTestResponse) XXX_Merge

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

func (*MsgLoadTestResponse) XXX_Size

func (m *MsgLoadTestResponse) XXX_Size() int

func (*MsgLoadTestResponse) XXX_Unmarshal

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

type MsgServer

type MsgServer interface {
	// LoadTest defines a method for executing a sequence of load test operations.
	LoadTest(context.Context, *MsgLoadTest) (*MsgLoadTestResponse, error)
}

MsgServer is the server API for Msg service.

type Op

type Op struct {
	Seed        uint64 `protobuf:"varint,1,opt,name=seed,proto3" json:"seed,omitempty"`
	Actor       string `protobuf:"bytes,2,opt,name=actor,proto3" json:"actor,omitempty"`
	KeyLength   uint64 `protobuf:"varint,3,opt,name=key_length,json=keyLength,proto3" json:"key_length,omitempty"`
	ValueLength uint64 `protobuf:"varint,4,opt,name=value_length,json=valueLength,proto3" json:"value_length,omitempty"`
	Iterations  uint32 `protobuf:"varint,5,opt,name=iterations,proto3" json:"iterations,omitempty"`
	Delete      bool   `protobuf:"varint,6,opt,name=delete,proto3" json:"delete,omitempty"`
	Exists      bool   `protobuf:"varint,7,opt,name=exists,proto3" json:"exists,omitempty"`
}

Op is a message describing a benchmark operation.

func (*Op) Descriptor

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

func (*Op) GetActor

func (m *Op) GetActor() string

func (*Op) GetDelete

func (m *Op) GetDelete() bool

func (*Op) GetExists

func (m *Op) GetExists() bool

func (*Op) GetIterations

func (m *Op) GetIterations() uint32

func (*Op) GetKeyLength

func (m *Op) GetKeyLength() uint64

func (*Op) GetSeed

func (m *Op) GetSeed() uint64

func (*Op) GetValueLength

func (m *Op) GetValueLength() uint64

func (*Op) Marshal

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

func (*Op) MarshalTo

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

func (*Op) MarshalToSizedBuffer

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

func (*Op) ProtoMessage

func (*Op) ProtoMessage()

func (*Op) Reset

func (m *Op) Reset()

func (*Op) Size

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

func (*Op) String

func (m *Op) String() string

func (*Op) Unmarshal

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

func (*Op) XXX_DiscardUnknown

func (m *Op) XXX_DiscardUnknown()

func (*Op) XXX_Marshal

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

func (*Op) XXX_Merge

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

func (*Op) XXX_Size

func (m *Op) XXX_Size() int

func (*Op) XXX_Unmarshal

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

type UnimplementedMsgServer

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

func (*UnimplementedMsgServer) LoadTest

Directories

Path Synopsis
client
cli

Jump to

Keyboard shortcuts

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