v1

package
v0.0.0-...-b383f3c Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package v1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	RunLoadtestRequest_BroadcastTxMethod_name = map[int32]string{
		0: "BROADCAST_TX_METHOD_UNSPECIFIED",
		1: "BROADCAST_TX_METHOD_SYNC",
		2: "BROADCAST_TX_METHOD_ASYNC",
		3: "BROADCAST_TX_METHOD_COMMIT",
	}
	RunLoadtestRequest_BroadcastTxMethod_value = map[string]int32{
		"BROADCAST_TX_METHOD_UNSPECIFIED": 0,
		"BROADCAST_TX_METHOD_SYNC":        1,
		"BROADCAST_TX_METHOD_ASYNC":       2,
		"BROADCAST_TX_METHOD_COMMIT":      3,
	}
)

Enum value maps for RunLoadtestRequest_BroadcastTxMethod.

View Source
var (
	RunLoadtestRequest_EndpointSelectMethod_name = map[int32]string{
		0: "ENDPOINT_SELECT_METHOD_UNSPECIFIED",
		1: "ENDPOINT_SELECT_METHOD_SUPPLIED",
		2: "ENDPOINT_SELECT_METHOD_DISCOVERED",
		3: "ENDPOINT_SELECT_METHOD_ANY",
	}
	RunLoadtestRequest_EndpointSelectMethod_value = map[string]int32{
		"ENDPOINT_SELECT_METHOD_UNSPECIFIED": 0,
		"ENDPOINT_SELECT_METHOD_SUPPLIED":    1,
		"ENDPOINT_SELECT_METHOD_DISCOVERED":  2,
		"ENDPOINT_SELECT_METHOD_ANY":         3,
	}
)

Enum value maps for RunLoadtestRequest_EndpointSelectMethod.

View Source
var File_orijtech_cosmosloadtester_v1_loadtest_service_proto protoreflect.FileDescriptor
View Source
var LoadtestService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "orijtech.cosmosloadtester.v1.LoadtestService",
	HandlerType: (*LoadtestServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "RunLoadtest",
			Handler:    _LoadtestService_RunLoadtest_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "orijtech/cosmosloadtester/v1/loadtest_service.proto",
}

LoadtestService_ServiceDesc is the grpc.ServiceDesc for LoadtestService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterLoadtestServiceHandler

func RegisterLoadtestServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterLoadtestServiceHandler registers the http handlers for service LoadtestService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterLoadtestServiceHandlerClient

func RegisterLoadtestServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client LoadtestServiceClient) error

RegisterLoadtestServiceHandlerClient registers the http handlers for service LoadtestService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "LoadtestServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "LoadtestServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "LoadtestServiceClient" to call the correct interceptors.

func RegisterLoadtestServiceHandlerFromEndpoint

func RegisterLoadtestServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterLoadtestServiceHandlerFromEndpoint is same as RegisterLoadtestServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterLoadtestServiceHandlerServer

func RegisterLoadtestServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server LoadtestServiceServer) error

RegisterLoadtestServiceHandlerServer registers the http handlers for service LoadtestService to "mux". UnaryRPC :call LoadtestServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterLoadtestServiceHandlerFromEndpoint instead.

func RegisterLoadtestServiceServer

func RegisterLoadtestServiceServer(s grpc.ServiceRegistrar, srv LoadtestServiceServer)

Types

type LoadtestServiceClient

type LoadtestServiceClient interface {
	RunLoadtest(ctx context.Context, in *RunLoadtestRequest, opts ...grpc.CallOption) (*RunLoadtestResponse, error)
}

LoadtestServiceClient is the client API for LoadtestService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type LoadtestServiceServer

type LoadtestServiceServer interface {
	RunLoadtest(context.Context, *RunLoadtestRequest) (*RunLoadtestResponse, error)
	// contains filtered or unexported methods
}

LoadtestServiceServer is the server API for LoadtestService service. All implementations must embed UnimplementedLoadtestServiceServer for forward compatibility

type PerSecond

type PerSecond struct {

	// Indicates the ordinal number of the current second e.g. for the 8th second, sec=7, 1st second, sec=0.
	// Second is creating by using the lower bounds/floor of the second e.g. values at:
	//    0.74 sec fall within sec=0
	//    9.94 sec fall within sec=9
	Sec int64 `protobuf:"varint,1,opt,name=sec,proto3" json:"sec,omitempty"`
	// Indicates the queries per second captured by stuffing points within a second booundary.
	Qps float64 `protobuf:"fixed64,2,opt,name=qps,proto3" json:"qps,omitempty"`
	// Bytes indicates the bytes sent within the time period.
	BytesSent float64 `protobuf:"fixed64,3,opt,name=bytes_sent,json=bytesSent,proto3" json:"bytes_sent,omitempty"`
	// Indicates the aggregated percentile values by bytes.
	BytesRankings *Ranking `protobuf:"bytes,4,opt,name=bytes_rankings,json=bytesRankings,proto3" json:"bytes_rankings,omitempty"`
	// Indicates the aggregated percentile values by latency.
	LatencyRankings *Ranking `protobuf:"bytes,5,opt,name=latency_rankings,json=latencyRankings,proto3" json:"latency_rankings,omitempty"`
	// contains filtered or unexported fields
}

func (*PerSecond) Descriptor deprecated

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

Deprecated: Use PerSecond.ProtoReflect.Descriptor instead.

func (*PerSecond) GetBytesRankings

func (x *PerSecond) GetBytesRankings() *Ranking

func (*PerSecond) GetBytesSent

func (x *PerSecond) GetBytesSent() float64

func (*PerSecond) GetLatencyRankings

func (x *PerSecond) GetLatencyRankings() *Ranking

func (*PerSecond) GetQps

func (x *PerSecond) GetQps() float64

func (*PerSecond) GetSec

func (x *PerSecond) GetSec() int64

func (*PerSecond) ProtoMessage

func (*PerSecond) ProtoMessage()

func (*PerSecond) ProtoReflect

func (x *PerSecond) ProtoReflect() protoreflect.Message

func (*PerSecond) Reset

func (x *PerSecond) Reset()

func (*PerSecond) String

func (x *PerSecond) String() string

type Percentile

type Percentile struct {

	// The time relative to the request's start time.
	StartOffset *durationpb.Duration `protobuf:"bytes,1,opt,name=start_offset,json=startOffset,proto3" json:"start_offset,omitempty"`
	// The time between request send and receipt of a response.
	Latency *durationpb.Duration `protobuf:"bytes,2,opt,name=latency,proto3" json:"latency,omitempty"`
	// The number of bytes sent.
	BytesSent int64 `protobuf:"varint,3,opt,name=bytes_sent,json=bytesSent,proto3" json:"bytes_sent,omitempty"`
	// The human friendly value of the percentile's occurence. It is useful for easy debugging.
	AtStr string `protobuf:"bytes,4,opt,name=at_str,json=atStr,proto3" json:"at_str,omitempty"`
	// contains filtered or unexported fields
}

func (*Percentile) Descriptor deprecated

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

Deprecated: Use Percentile.ProtoReflect.Descriptor instead.

func (*Percentile) GetAtStr

func (x *Percentile) GetAtStr() string

func (*Percentile) GetBytesSent

func (x *Percentile) GetBytesSent() int64

func (*Percentile) GetLatency

func (x *Percentile) GetLatency() *durationpb.Duration

func (*Percentile) GetStartOffset

func (x *Percentile) GetStartOffset() *durationpb.Duration

func (*Percentile) ProtoMessage

func (*Percentile) ProtoMessage()

func (*Percentile) ProtoReflect

func (x *Percentile) ProtoReflect() protoreflect.Message

func (*Percentile) Reset

func (x *Percentile) Reset()

func (*Percentile) String

func (x *Percentile) String() string

type Ranking

type Ranking struct {

	// The 50th percentile value aka the median.
	P50 *Percentile `protobuf:"bytes,1,opt,name=p50,proto3" json:"p50,omitempty"`
	// The 75th percentile value.
	P75 *Percentile `protobuf:"bytes,2,opt,name=p75,proto3" json:"p75,omitempty"`
	// The 90th percentile value.
	P90 *Percentile `protobuf:"bytes,3,opt,name=p90,proto3" json:"p90,omitempty"`
	// The 95th percentile value.
	P95 *Percentile `protobuf:"bytes,4,opt,name=p95,proto3" json:"p95,omitempty"`
	// The 99th percentile value, useful to identify outliers.
	P99 *Percentile `protobuf:"bytes,5,opt,name=p99,proto3" json:"p99,omitempty"`
	// contains filtered or unexported fields
}

func (*Ranking) Descriptor deprecated

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

Deprecated: Use Ranking.ProtoReflect.Descriptor instead.

func (*Ranking) GetP50

func (x *Ranking) GetP50() *Percentile

func (*Ranking) GetP75

func (x *Ranking) GetP75() *Percentile

func (*Ranking) GetP90

func (x *Ranking) GetP90() *Percentile

func (*Ranking) GetP95

func (x *Ranking) GetP95() *Percentile

func (*Ranking) GetP99

func (x *Ranking) GetP99() *Percentile

func (*Ranking) ProtoMessage

func (*Ranking) ProtoMessage()

func (*Ranking) ProtoReflect

func (x *Ranking) ProtoReflect() protoreflect.Message

func (*Ranking) Reset

func (x *Ranking) Reset()

func (*Ranking) String

func (x *Ranking) String() string

type RunLoadtestRequest

type RunLoadtestRequest struct {

	// The identifier of the client factory to use for generating load testing transactions.
	// Maps to --client-factory in tm-load-test.
	ClientFactory string `protobuf:"bytes,1,opt,name=client_factory,json=clientFactory,proto3" json:"client_factory,omitempty"`
	// The number of connections to open to each endpoint simultaneously.
	// Maps to --connections in tm-load-test.
	ConnectionCount int32 `protobuf:"varint,2,opt,name=connection_count,json=connectionCount,proto3" json:"connection_count,omitempty"`
	// The duration (in seconds) for which to handle the load test.
	// Maps to --time in tm-load-test.
	Duration *durationpb.Duration `protobuf:"bytes,3,opt,name=duration,proto3" json:"duration,omitempty"`
	// The period (in seconds) at which to send batches of transactions.
	// Maps to --send-period in tm-load-test.
	SendPeriod *durationpb.Duration `protobuf:"bytes,4,opt,name=send_period,json=sendPeriod,proto3" json:"send_period,omitempty"`
	// The number of transactions to generate each second on each connection, to each endpoint.
	// Maps to --rate in tm-load-test.
	TransactionsPerSecond int32 `` /* 127-byte string literal not displayed */
	// The size of each transaction, in bytes - must be greater than 40.
	// Maps to --size in tm-load-test.
	TransactionSizeBytes int32 `protobuf:"varint,6,opt,name=transaction_size_bytes,json=transactionSizeBytes,proto3" json:"transaction_size_bytes,omitempty"`
	// The maximum number of transactions to send - set to -1 to turn off this limit.
	// Maps to --count in tm-load-test.
	TransactionCount int32 `protobuf:"varint,7,opt,name=transaction_count,json=transactionCount,proto3" json:"transaction_count,omitempty"`
	// The broadcast_tx method to use when submitting transactions - can be async, sync or commit.
	// Maps to --broadcast-tx-method in tm-load-test.
	BroadcastTxMethod RunLoadtestRequest_BroadcastTxMethod `` /* 186-byte string literal not displayed */
	// A list of URLs indicating Tendermint WebSockets RPC endpoints to which to connect.
	// Maps to --endpoints in tm-load-test.
	Endpoints []string `protobuf:"bytes,9,rep,name=endpoints,proto3" json:"endpoints,omitempty"`
	// The method by which to select endpoints.
	// Maps to --endpoint-select-method in tm-load-test.
	EndpointSelectMethod RunLoadtestRequest_EndpointSelectMethod `` /* 199-byte string literal not displayed */
	// The minimum number of peers to expect when crawling the P2P network from the specified endpoint(s) prior to waiting for workers to connect.
	// Maps to --expect-peers in tm-load-test.
	ExpectPeersCount int32 `protobuf:"varint,11,opt,name=expect_peers_count,json=expectPeersCount,proto3" json:"expect_peers_count,omitempty"`
	// The maximum number of endpoints to use for testing, where 0 means unlimited.
	// Maps to --max-endpoints in tm-load-test.
	MaxEndpointCount int32 `protobuf:"varint,12,opt,name=max_endpoint_count,json=maxEndpointCount,proto3" json:"max_endpoint_count,omitempty"`
	// The number of seconds to wait for all required peers to connect if expect-peers > 0.
	// Maps to --peer-connect-timeout in tm-load-test.
	PeerConnectTimeout *durationpb.Duration `protobuf:"bytes,13,opt,name=peer_connect_timeout,json=peerConnectTimeout,proto3" json:"peer_connect_timeout,omitempty"`
	// The minimum number of peers to which each peer must be connected before starting the load test.
	// Maps to --min-peer-connectvity in tm-load-test.
	MinPeerConnectivityCount int32 `` /* 139-byte string literal not displayed */
	// Where to store aggregate statistics (in CSV format) for the load test.
	// Maps to --stats-output in tm-load-test.
	StatsOutputFilePath string `protobuf:"bytes,15,opt,name=stats_output_file_path,json=statsOutputFilePath,proto3" json:"stats_output_file_path,omitempty"`
	// contains filtered or unexported fields
}

func (*RunLoadtestRequest) Descriptor deprecated

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

Deprecated: Use RunLoadtestRequest.ProtoReflect.Descriptor instead.

func (*RunLoadtestRequest) GetBroadcastTxMethod

func (x *RunLoadtestRequest) GetBroadcastTxMethod() RunLoadtestRequest_BroadcastTxMethod

func (*RunLoadtestRequest) GetClientFactory

func (x *RunLoadtestRequest) GetClientFactory() string

func (*RunLoadtestRequest) GetConnectionCount

func (x *RunLoadtestRequest) GetConnectionCount() int32

func (*RunLoadtestRequest) GetDuration

func (x *RunLoadtestRequest) GetDuration() *durationpb.Duration

func (*RunLoadtestRequest) GetEndpointSelectMethod

func (x *RunLoadtestRequest) GetEndpointSelectMethod() RunLoadtestRequest_EndpointSelectMethod

func (*RunLoadtestRequest) GetEndpoints

func (x *RunLoadtestRequest) GetEndpoints() []string

func (*RunLoadtestRequest) GetExpectPeersCount

func (x *RunLoadtestRequest) GetExpectPeersCount() int32

func (*RunLoadtestRequest) GetMaxEndpointCount

func (x *RunLoadtestRequest) GetMaxEndpointCount() int32

func (*RunLoadtestRequest) GetMinPeerConnectivityCount

func (x *RunLoadtestRequest) GetMinPeerConnectivityCount() int32

func (*RunLoadtestRequest) GetPeerConnectTimeout

func (x *RunLoadtestRequest) GetPeerConnectTimeout() *durationpb.Duration

func (*RunLoadtestRequest) GetSendPeriod

func (x *RunLoadtestRequest) GetSendPeriod() *durationpb.Duration

func (*RunLoadtestRequest) GetStatsOutputFilePath

func (x *RunLoadtestRequest) GetStatsOutputFilePath() string

func (*RunLoadtestRequest) GetTransactionCount

func (x *RunLoadtestRequest) GetTransactionCount() int32

func (*RunLoadtestRequest) GetTransactionSizeBytes

func (x *RunLoadtestRequest) GetTransactionSizeBytes() int32

func (*RunLoadtestRequest) GetTransactionsPerSecond

func (x *RunLoadtestRequest) GetTransactionsPerSecond() int32

func (*RunLoadtestRequest) ProtoMessage

func (*RunLoadtestRequest) ProtoMessage()

func (*RunLoadtestRequest) ProtoReflect

func (x *RunLoadtestRequest) ProtoReflect() protoreflect.Message

func (*RunLoadtestRequest) Reset

func (x *RunLoadtestRequest) Reset()

func (*RunLoadtestRequest) String

func (x *RunLoadtestRequest) String() string

type RunLoadtestRequest_BroadcastTxMethod

type RunLoadtestRequest_BroadcastTxMethod int32
const (
	// Default value. This value is unused.
	RunLoadtestRequest_BROADCAST_TX_METHOD_UNSPECIFIED RunLoadtestRequest_BroadcastTxMethod = 0
	RunLoadtestRequest_BROADCAST_TX_METHOD_SYNC        RunLoadtestRequest_BroadcastTxMethod = 1
	RunLoadtestRequest_BROADCAST_TX_METHOD_ASYNC       RunLoadtestRequest_BroadcastTxMethod = 2
	RunLoadtestRequest_BROADCAST_TX_METHOD_COMMIT      RunLoadtestRequest_BroadcastTxMethod = 3
)

func (RunLoadtestRequest_BroadcastTxMethod) Descriptor

func (RunLoadtestRequest_BroadcastTxMethod) Enum

func (RunLoadtestRequest_BroadcastTxMethod) EnumDescriptor deprecated

func (RunLoadtestRequest_BroadcastTxMethod) EnumDescriptor() ([]byte, []int)

Deprecated: Use RunLoadtestRequest_BroadcastTxMethod.Descriptor instead.

func (RunLoadtestRequest_BroadcastTxMethod) Number

func (RunLoadtestRequest_BroadcastTxMethod) String

func (RunLoadtestRequest_BroadcastTxMethod) Type

type RunLoadtestRequest_EndpointSelectMethod

type RunLoadtestRequest_EndpointSelectMethod int32
const (
	// Default value. This value is unused.
	RunLoadtestRequest_ENDPOINT_SELECT_METHOD_UNSPECIFIED RunLoadtestRequest_EndpointSelectMethod = 0
	// Select only the supplied endpoint(s) for load testing (the default).
	RunLoadtestRequest_ENDPOINT_SELECT_METHOD_SUPPLIED RunLoadtestRequest_EndpointSelectMethod = 1
	// Select newly discovered endpoints only (excluding supplied endpoints).
	RunLoadtestRequest_ENDPOINT_SELECT_METHOD_DISCOVERED RunLoadtestRequest_EndpointSelectMethod = 2
	// Select from any of supplied and/or discovered endpoints.
	RunLoadtestRequest_ENDPOINT_SELECT_METHOD_ANY RunLoadtestRequest_EndpointSelectMethod = 3
)

func (RunLoadtestRequest_EndpointSelectMethod) Descriptor

func (RunLoadtestRequest_EndpointSelectMethod) Enum

func (RunLoadtestRequest_EndpointSelectMethod) EnumDescriptor deprecated

func (RunLoadtestRequest_EndpointSelectMethod) EnumDescriptor() ([]byte, []int)

Deprecated: Use RunLoadtestRequest_EndpointSelectMethod.Descriptor instead.

func (RunLoadtestRequest_EndpointSelectMethod) Number

func (RunLoadtestRequest_EndpointSelectMethod) String

func (RunLoadtestRequest_EndpointSelectMethod) Type

type RunLoadtestResponse

type RunLoadtestResponse struct {

	// The total number of transactions sent.
	// Corresponds to total_time in tm-load-test.
	TotalTxs int64 `protobuf:"varint,1,opt,name=total_txs,json=totalTxs,proto3" json:"total_txs,omitempty"`
	// The total time taken to send `total_txs` transactions.
	// Corresponds to total_txs in tm-load-test.
	TotalTime *durationpb.Duration `protobuf:"bytes,2,opt,name=total_time,json=totalTime,proto3" json:"total_time,omitempty"`
	// The cumulative number of bytes sent as transactions.
	// Corresponds to total_bytes in tm-load-test.
	TotalBytes int64 `protobuf:"varint,3,opt,name=total_bytes,json=totalBytes,proto3" json:"total_bytes,omitempty"`
	// The rate at which transactions were submitted (tx/sec).
	// Corresponds to avg_tx_rate in tm-load-test.
	AvgTxsPerSecond float64 `protobuf:"fixed64,4,opt,name=avg_txs_per_second,json=avgTxsPerSecond,proto3" json:"avg_txs_per_second,omitempty"`
	// The rate at which data was transmitted in transactions (bytes/sec).
	// Corresponds to avg_data_rate in tm-load-test.
	AvgBytesPerSecond float64 `protobuf:"fixed64,5,opt,name=avg_bytes_per_second,json=avgBytesPerSecond,proto3" json:"avg_bytes_per_second,omitempty"`
	// The respective points per second from 0 until the request's max_time.
	PerSec []*PerSecond `protobuf:"bytes,6,rep,name=per_sec,json=perSec,proto3" json:"per_sec,omitempty"`
	// contains filtered or unexported fields
}

func (*RunLoadtestResponse) Descriptor deprecated

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

Deprecated: Use RunLoadtestResponse.ProtoReflect.Descriptor instead.

func (*RunLoadtestResponse) GetAvgBytesPerSecond

func (x *RunLoadtestResponse) GetAvgBytesPerSecond() float64

func (*RunLoadtestResponse) GetAvgTxsPerSecond

func (x *RunLoadtestResponse) GetAvgTxsPerSecond() float64

func (*RunLoadtestResponse) GetPerSec

func (x *RunLoadtestResponse) GetPerSec() []*PerSecond

func (*RunLoadtestResponse) GetTotalBytes

func (x *RunLoadtestResponse) GetTotalBytes() int64

func (*RunLoadtestResponse) GetTotalTime

func (x *RunLoadtestResponse) GetTotalTime() *durationpb.Duration

func (*RunLoadtestResponse) GetTotalTxs

func (x *RunLoadtestResponse) GetTotalTxs() int64

func (*RunLoadtestResponse) ProtoMessage

func (*RunLoadtestResponse) ProtoMessage()

func (*RunLoadtestResponse) ProtoReflect

func (x *RunLoadtestResponse) ProtoReflect() protoreflect.Message

func (*RunLoadtestResponse) Reset

func (x *RunLoadtestResponse) Reset()

func (*RunLoadtestResponse) String

func (x *RunLoadtestResponse) String() string

type UnimplementedLoadtestServiceServer

type UnimplementedLoadtestServiceServer struct {
}

UnimplementedLoadtestServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedLoadtestServiceServer) RunLoadtest

type UnsafeLoadtestServiceServer

type UnsafeLoadtestServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeLoadtestServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to LoadtestServiceServer will result in compilation errors.

Jump to

Keyboard shortcuts

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