Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterProfilingServer(s grpc.ServiceRegistrar, srv ProfilingServer)
- type EnableRequest
- type EnableResponse
- type GetStreamStatsRequest
- type GetStreamStatsResponse
- func (*GetStreamStatsResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetStreamStatsResponse) GetStreamStats() []*Stat
- func (*GetStreamStatsResponse) ProtoMessage()
- func (x *GetStreamStatsResponse) ProtoReflect() protoreflect.Message
- func (x *GetStreamStatsResponse) Reset()
- func (x *GetStreamStatsResponse) String() string
- type ProfilingClient
- type ProfilingServer
- type Stat
- type Timer
- func (*Timer) Descriptor() ([]byte, []int)deprecated
- func (x *Timer) GetBeginNsec() int32
- func (x *Timer) GetBeginSec() int64
- func (x *Timer) GetEndNsec() int32
- func (x *Timer) GetEndSec() int64
- func (x *Timer) GetGoId() int64
- func (x *Timer) GetTags() string
- func (*Timer) ProtoMessage()
- func (x *Timer) ProtoReflect() protoreflect.Message
- func (x *Timer) Reset()
- func (x *Timer) String() string
- type UnimplementedProfilingServer
- type UnsafeProfilingServer
Constants ¶
const ( Profiling_Enable_FullMethodName = "/grpc.go.profiling.v1alpha.Profiling/Enable" Profiling_GetStreamStats_FullMethodName = "/grpc.go.profiling.v1alpha.Profiling/GetStreamStats" )
Variables ¶
var File_profiling_proto_service_proto protoreflect.FileDescriptor
var Profiling_ServiceDesc = grpc.ServiceDesc{ ServiceName: "grpc.go.profiling.v1alpha.Profiling", HandlerType: (*ProfilingServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Enable", Handler: _Profiling_Enable_Handler, }, { MethodName: "GetStreamStats", Handler: _Profiling_GetStreamStats_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "profiling/proto/service.proto", }
Profiling_ServiceDesc is the grpc.ServiceDesc for Profiling service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterProfilingServer ¶
func RegisterProfilingServer(s grpc.ServiceRegistrar, srv ProfilingServer)
Types ¶
type EnableRequest ¶
type EnableRequest struct { // Setting this to true will enable profiling. Setting this to false will // disable profiling. Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"` // contains filtered or unexported fields }
EnableRequest defines the fields in a /Profiling/Enable method request to toggle profiling on and off within a gRPC program.
func (*EnableRequest) Descriptor
deprecated
func (*EnableRequest) Descriptor() ([]byte, []int)
Deprecated: Use EnableRequest.ProtoReflect.Descriptor instead.
func (*EnableRequest) GetEnabled ¶
func (x *EnableRequest) GetEnabled() bool
func (*EnableRequest) ProtoMessage ¶
func (*EnableRequest) ProtoMessage()
func (*EnableRequest) ProtoReflect ¶ added in v1.33.2
func (x *EnableRequest) ProtoReflect() protoreflect.Message
func (*EnableRequest) Reset ¶
func (x *EnableRequest) Reset()
func (*EnableRequest) String ¶
func (x *EnableRequest) String() string
type EnableResponse ¶
type EnableResponse struct {
// contains filtered or unexported fields
}
EnableResponse defines the fields in a /Profiling/Enable method response.
func (*EnableResponse) Descriptor
deprecated
func (*EnableResponse) Descriptor() ([]byte, []int)
Deprecated: Use EnableResponse.ProtoReflect.Descriptor instead.
func (*EnableResponse) ProtoMessage ¶
func (*EnableResponse) ProtoMessage()
func (*EnableResponse) ProtoReflect ¶ added in v1.33.2
func (x *EnableResponse) ProtoReflect() protoreflect.Message
func (*EnableResponse) Reset ¶
func (x *EnableResponse) Reset()
func (*EnableResponse) String ¶
func (x *EnableResponse) String() string
type GetStreamStatsRequest ¶
type GetStreamStatsRequest struct {
// contains filtered or unexported fields
}
GetStreamStatsRequest defines the fields in a /Profiling/GetStreamStats method request to retrieve stream-level stats in a gRPC client/server.
func (*GetStreamStatsRequest) Descriptor
deprecated
func (*GetStreamStatsRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetStreamStatsRequest.ProtoReflect.Descriptor instead.
func (*GetStreamStatsRequest) ProtoMessage ¶
func (*GetStreamStatsRequest) ProtoMessage()
func (*GetStreamStatsRequest) ProtoReflect ¶ added in v1.33.2
func (x *GetStreamStatsRequest) ProtoReflect() protoreflect.Message
func (*GetStreamStatsRequest) Reset ¶
func (x *GetStreamStatsRequest) Reset()
func (*GetStreamStatsRequest) String ¶
func (x *GetStreamStatsRequest) String() string
type GetStreamStatsResponse ¶
type GetStreamStatsResponse struct { StreamStats []*Stat `protobuf:"bytes,1,rep,name=stream_stats,json=streamStats,proto3" json:"stream_stats,omitempty"` // contains filtered or unexported fields }
GetStreamStatsResponse defines the fields in a /Profiling/GetStreamStats method response.
func (*GetStreamStatsResponse) Descriptor
deprecated
func (*GetStreamStatsResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetStreamStatsResponse.ProtoReflect.Descriptor instead.
func (*GetStreamStatsResponse) GetStreamStats ¶
func (x *GetStreamStatsResponse) GetStreamStats() []*Stat
func (*GetStreamStatsResponse) ProtoMessage ¶
func (*GetStreamStatsResponse) ProtoMessage()
func (*GetStreamStatsResponse) ProtoReflect ¶ added in v1.33.2
func (x *GetStreamStatsResponse) ProtoReflect() protoreflect.Message
func (*GetStreamStatsResponse) Reset ¶
func (x *GetStreamStatsResponse) Reset()
func (*GetStreamStatsResponse) String ¶
func (x *GetStreamStatsResponse) String() string
type ProfilingClient ¶
type ProfilingClient interface { // Enable allows users to toggle profiling on and off remotely. Enable(ctx context.Context, in *EnableRequest, opts ...grpc.CallOption) (*EnableResponse, error) // GetStreamStats is used to retrieve an array of stream-level stats from a // gRPC client/server. GetStreamStats(ctx context.Context, in *GetStreamStatsRequest, opts ...grpc.CallOption) (*GetStreamStatsResponse, error) }
ProfilingClient is the client API for Profiling 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.
The Profiling service exposes functions to remotely manage the gRPC profiling behaviour in a program.
func NewProfilingClient ¶
func NewProfilingClient(cc grpc.ClientConnInterface) ProfilingClient
type ProfilingServer ¶
type ProfilingServer interface { // Enable allows users to toggle profiling on and off remotely. Enable(context.Context, *EnableRequest) (*EnableResponse, error) // GetStreamStats is used to retrieve an array of stream-level stats from a // gRPC client/server. GetStreamStats(context.Context, *GetStreamStatsRequest) (*GetStreamStatsResponse, error) }
ProfilingServer is the server API for Profiling service. All implementations should embed UnimplementedProfilingServer for forward compatibility.
The Profiling service exposes functions to remotely manage the gRPC profiling behaviour in a program.
type Stat ¶
type Stat struct { // tags is a comma-separated list of strings used to categorize a stat. Tags string `protobuf:"bytes,1,opt,name=tags,proto3" json:"tags,omitempty"` // timers is an array of Timers, each representing a different // (but possibly overlapping) component within this stat. Timers []*Timer `protobuf:"bytes,2,rep,name=timers,proto3" json:"timers,omitempty"` // metadata is an array of bytes used to uniquely identify a stat with an // undefined encoding format. For example, the Stats returned by the // /Profiling/GetStreamStats service use the metadata field to encode the // connection ID and the stream ID of each query. Metadata []byte `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` // contains filtered or unexported fields }
A Stat is a collection of Timers along with some additional metadata to tag and identify itself.
func (*Stat) Descriptor
deprecated
func (*Stat) GetMetadata ¶
func (*Stat) ProtoMessage ¶
func (*Stat) ProtoMessage()
func (*Stat) ProtoReflect ¶ added in v1.33.2
func (x *Stat) ProtoReflect() protoreflect.Message
type Timer ¶
type Timer struct { // tags is a comma-separated list of strings used to tag a timer. Tags string `protobuf:"bytes,1,opt,name=tags,proto3" json:"tags,omitempty"` // begin_sec and begin_nsec are the start epoch second and nanosecond, // respectively, of the component profiled by this timer in UTC. begin_nsec // must be a non-negative integer. BeginSec int64 `protobuf:"varint,2,opt,name=begin_sec,json=beginSec,proto3" json:"begin_sec,omitempty"` BeginNsec int32 `protobuf:"varint,3,opt,name=begin_nsec,json=beginNsec,proto3" json:"begin_nsec,omitempty"` // end_sec and end_nsec are the end epoch second and nanosecond, // respectively, of the component profiled by this timer in UTC. end_nsec // must be a non-negative integer. EndSec int64 `protobuf:"varint,4,opt,name=end_sec,json=endSec,proto3" json:"end_sec,omitempty"` EndNsec int32 `protobuf:"varint,5,opt,name=end_nsec,json=endNsec,proto3" json:"end_nsec,omitempty"` // go_id is the goroutine ID of the component being profiled. GoId int64 `protobuf:"varint,6,opt,name=go_id,json=goId,proto3" json:"go_id,omitempty"` // contains filtered or unexported fields }
A Timer measures the start and end of execution of a component within gRPC that's being profiled. It includes a tag and some additional metadata to identify itself.
func (*Timer) Descriptor
deprecated
func (*Timer) GetBeginNsec ¶
func (*Timer) GetBeginSec ¶
func (*Timer) GetEndNsec ¶
func (*Timer) ProtoMessage ¶
func (*Timer) ProtoMessage()
func (*Timer) ProtoReflect ¶ added in v1.33.2
func (x *Timer) ProtoReflect() protoreflect.Message
type UnimplementedProfilingServer ¶
type UnimplementedProfilingServer struct{}
UnimplementedProfilingServer should 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 (UnimplementedProfilingServer) Enable ¶
func (UnimplementedProfilingServer) Enable(context.Context, *EnableRequest) (*EnableResponse, error)
func (UnimplementedProfilingServer) GetStreamStats ¶
func (UnimplementedProfilingServer) GetStreamStats(context.Context, *GetStreamStatsRequest) (*GetStreamStatsResponse, error)
type UnsafeProfilingServer ¶ added in v1.33.0
type UnsafeProfilingServer interface {
// contains filtered or unexported methods
}
UnsafeProfilingServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ProfilingServer will result in compilation errors.