bench

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BenchService_Echo_FullMethodName     = "/bench.BenchService/Echo"
	BenchService_Download_FullMethodName = "/bench.BenchService/Download"
	BenchService_Read_FullMethodName     = "/bench.BenchService/Read"
)

Variables

View Source
var BenchService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "bench.BenchService",
	HandlerType: (*BenchServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Echo",
			Handler:    _BenchService_Echo_Handler,
		},
		{
			MethodName: "Read",
			Handler:    _BenchService_Read_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Download",
			Handler:       _BenchService_Download_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "pkg/transport/proto/bench.proto",
}

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

View Source
var File_pkg_transport_proto_bench_proto protoreflect.FileDescriptor

Functions

func RegisterBenchServiceServer

func RegisterBenchServiceServer(s grpc.ServiceRegistrar, srv BenchServiceServer)

Types

type BenchServiceClient

type BenchServiceClient interface {
	Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoReply, error)
	Download(ctx context.Context, in *DownloadRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Chunk], error)
	// Read is a fast unary range read (the FUSE cache-miss path): one small round trip on
	// the QUIC interactive channel, isolated from TCP bulk.
	Read(ctx context.Context, in *ReadRequest, opts ...grpc.CallOption) (*ReadReply, error)
}

BenchServiceClient is the client API for BenchService 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.

BenchService measures gRPC over QUIC vs TCP. Echo = unary round-trip latency; Download mirrors KeibiDrop's StreamFile (one request -> stream of chunks) for throughput.

type BenchServiceServer

type BenchServiceServer interface {
	Echo(context.Context, *EchoRequest) (*EchoReply, error)
	Download(*DownloadRequest, grpc.ServerStreamingServer[Chunk]) error
	// Read is a fast unary range read (the FUSE cache-miss path): one small round trip on
	// the QUIC interactive channel, isolated from TCP bulk.
	Read(context.Context, *ReadRequest) (*ReadReply, error)
	// contains filtered or unexported methods
}

BenchServiceServer is the server API for BenchService service. All implementations must embed UnimplementedBenchServiceServer for forward compatibility.

BenchService measures gRPC over QUIC vs TCP. Echo = unary round-trip latency; Download mirrors KeibiDrop's StreamFile (one request -> stream of chunks) for throughput.

type BenchService_DownloadClient

type BenchService_DownloadClient = grpc.ServerStreamingClient[Chunk]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type BenchService_DownloadServer

type BenchService_DownloadServer = grpc.ServerStreamingServer[Chunk]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type Chunk

type Chunk struct {
	Data   []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	Offset uint64 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"` // byte offset of this chunk within the stream
	// contains filtered or unexported fields
}

func (*Chunk) Descriptor deprecated

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

Deprecated: Use Chunk.ProtoReflect.Descriptor instead.

func (*Chunk) GetData

func (x *Chunk) GetData() []byte

func (*Chunk) GetOffset

func (x *Chunk) GetOffset() uint64

func (*Chunk) ProtoMessage

func (*Chunk) ProtoMessage()

func (*Chunk) ProtoReflect

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

func (*Chunk) Reset

func (x *Chunk) Reset()

func (*Chunk) String

func (x *Chunk) String() string

type DownloadRequest

type DownloadRequest struct {
	TotalBytes  uint64 `protobuf:"varint,1,opt,name=total_bytes,json=totalBytes,proto3" json:"total_bytes,omitempty"`    // total size of the transfer
	ChunkSize   uint32 `protobuf:"varint,2,opt,name=chunk_size,json=chunkSize,proto3" json:"chunk_size,omitempty"`       // bytes per Chunk (0 -> server default)
	StartOffset uint64 `protobuf:"varint,3,opt,name=start_offset,json=startOffset,proto3" json:"start_offset,omitempty"` // resume point: stream from here to total_bytes (0 = from start)
	// contains filtered or unexported fields
}

func (*DownloadRequest) Descriptor deprecated

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

Deprecated: Use DownloadRequest.ProtoReflect.Descriptor instead.

func (*DownloadRequest) GetChunkSize

func (x *DownloadRequest) GetChunkSize() uint32

func (*DownloadRequest) GetStartOffset

func (x *DownloadRequest) GetStartOffset() uint64

func (*DownloadRequest) GetTotalBytes

func (x *DownloadRequest) GetTotalBytes() uint64

func (*DownloadRequest) ProtoMessage

func (*DownloadRequest) ProtoMessage()

func (*DownloadRequest) ProtoReflect

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

func (*DownloadRequest) Reset

func (x *DownloadRequest) Reset()

func (*DownloadRequest) String

func (x *DownloadRequest) String() string

type EchoReply

type EchoReply struct {
	Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"`
	// contains filtered or unexported fields
}

func (*EchoReply) Descriptor deprecated

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

Deprecated: Use EchoReply.ProtoReflect.Descriptor instead.

func (*EchoReply) GetPayload

func (x *EchoReply) GetPayload() []byte

func (*EchoReply) ProtoMessage

func (*EchoReply) ProtoMessage()

func (*EchoReply) ProtoReflect

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

func (*EchoReply) Reset

func (x *EchoReply) Reset()

func (*EchoReply) String

func (x *EchoReply) String() string

type EchoRequest

type EchoRequest struct {
	Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"`
	// contains filtered or unexported fields
}

func (*EchoRequest) Descriptor deprecated

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

Deprecated: Use EchoRequest.ProtoReflect.Descriptor instead.

func (*EchoRequest) GetPayload

func (x *EchoRequest) GetPayload() []byte

func (*EchoRequest) ProtoMessage

func (*EchoRequest) ProtoMessage()

func (*EchoRequest) ProtoReflect

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

func (*EchoRequest) Reset

func (x *EchoRequest) Reset()

func (*EchoRequest) String

func (x *EchoRequest) String() string

type ReadReply

type ReadReply struct {
	Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*ReadReply) Descriptor deprecated

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

Deprecated: Use ReadReply.ProtoReflect.Descriptor instead.

func (*ReadReply) GetData

func (x *ReadReply) GetData() []byte

func (*ReadReply) ProtoMessage

func (*ReadReply) ProtoMessage()

func (*ReadReply) ProtoReflect

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

func (*ReadReply) Reset

func (x *ReadReply) Reset()

func (*ReadReply) String

func (x *ReadReply) String() string

type ReadRequest

type ReadRequest struct {
	Offset uint64 `protobuf:"varint,1,opt,name=offset,proto3" json:"offset,omitempty"` // byte offset within the file
	Length uint32 `protobuf:"varint,2,opt,name=length,proto3" json:"length,omitempty"` // bytes to read
	// contains filtered or unexported fields
}

func (*ReadRequest) Descriptor deprecated

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

Deprecated: Use ReadRequest.ProtoReflect.Descriptor instead.

func (*ReadRequest) GetLength

func (x *ReadRequest) GetLength() uint32

func (*ReadRequest) GetOffset

func (x *ReadRequest) GetOffset() uint64

func (*ReadRequest) ProtoMessage

func (*ReadRequest) ProtoMessage()

func (*ReadRequest) ProtoReflect

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

func (*ReadRequest) Reset

func (x *ReadRequest) Reset()

func (*ReadRequest) String

func (x *ReadRequest) String() string

type UnimplementedBenchServiceServer

type UnimplementedBenchServiceServer struct{}

UnimplementedBenchServiceServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedBenchServiceServer) Download

func (UnimplementedBenchServiceServer) Echo

func (UnimplementedBenchServiceServer) Read

type UnsafeBenchServiceServer

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

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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