Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Name string ClientContext // contains filtered or unexported fields }
Client is the gRPC client to interactive with the ProfilerServer
- Name: the name of the client
- serviceURL: the URL of the gRPC server
- ProfilerClientContext: the context with the ProfilerClient and the connection
type ClientContext ¶
type ClientContext struct {
// contains filtered or unexported fields
}
ClientContext is the context with the ProfilerClient and the connection
- conn: the connection for the gRPC server
- service: the ProfilerClient
func (ClientContext) Close ¶
func (c ClientContext) Close() error
Close closes the connection for the gRPC server
type Server ¶
type Server struct { profilerrpc.UnimplementedProfilerServer // contains filtered or unexported fields }
Server is the gRPC server to provide the basic operations like (show/enable/disable) for the profiler
- name: the name of the server
- errMsg: the error message current server has (if enabled failed, it will have the error message)
- server: the http server for the profiler
- lock: the RW lock for the server
func (*Server) DisableProfiler ¶
DisableProfiler disables the profilerrpc. It will return the error when fails to shut down the profiler server.
func (*Server) EnableProfiler ¶
EnableProfiler enables the profiler with specific port number. It will fail if the profiler is already enabled or the port number is invalid(0). For the profiler server enabling failed, it will return the error message. And keep the above error message, then user can get the error message by op `show`. The normal(success) case will return the address of the profiler server.
func (*Server) ProfilerOP ¶
func (s *Server) ProfilerOP(_ context.Context, req *profilerrpc.ProfilerOPRequest) (*profilerrpc.ProfilerOPResponse, error)
ProfilerOP is the gRPC function to provide the entry point for the profiler operations
func (*Server) ShowProfiler ¶
ShowProfiler returns the address of the profiler