Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDebugServer ¶
func NewDebugServer(opts ...ServerOpt) api.DebugServer
NewDebugServer creates a grpc server that implements the Debug service interface
func RegisterProfileMetadata ¶
func RegisterProfileMetadata(m ProfileMetadata)
RegisterProfileMetadata registers the metadata used to describe how a profile snapshot is to be taken for a given profile name.
Types ¶
type ProfileMetadata ¶
type ProfileMetadata struct { Name string DefaultSampleRate int DefaultSleepDuration time.Duration SetSampleRate SetSampleRateFunc StartSnapshot StartSnapshotFunc StopSnapshot StopSnapshotFunc }
ProfileMetadata allows setting metadata for how a snapshot of a profile is taken. ProfileMetadata need only be provided for a registered profile if sleeping is required, or a sample rate must be set before doing the snapshot. For non-pprof Profiles, it must be provided (see "cpu").
type ServerOpt ¶
type ServerOpt func(*debugServer)
func WithVersionInfo ¶
WithVersionInfo sets the gitRef and release that will be returned by the debug version endpoint.
type SetSampleRateFunc ¶
SetSampleRateFunc sets the sample rate (in Hz). It must return the original value that will be passed to SetSampleRateFunc to reset it.
type StartSnapshotFunc ¶
StartSnapshotFunc starts the perf snapshot. The data must be written to the provided writer. If this function is not provided, the pprof profile with the matching name will be looked up and used to write the profile snapshot.
type StopSnapshotFunc ¶
type StopSnapshotFunc func() error
StopSnapshotFunc is called to stop the perf snapshot if provided