Documentation
¶
Overview ¶
Package runtime provides configuration to publish Go runtime statistics and HTTP helpers to expose Go runtime profiling data
Index ¶
Constants ¶
View Source
const ( ProfilingEnabled = "enabled" ProfilingDisabled = "disabled" )
View Source
const ( // ProfilingPortEnvKey specified the name of an environment variable that // may be used to override the default profiling port. ProfilingPortEnvKey = "PROFILING_PORT" // ProfilingDefaultPort specifies the default port where profiling data is available when profiling is enabled ProfilingDefaultPort = 8008 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Profiling string `json:"profiling,omitempty"`
ExportInterval time.Duration `json:"exportInterval,omitempty"`
}
func DefaultConfig ¶
func DefaultConfig() Config
func (*Config) ProfilingEnabled ¶
type ProfilingHandler ¶
type ProfilingHandler struct {
// contains filtered or unexported fields
}
func NewProfilingHandler ¶
func NewProfilingHandler() *ProfilingHandler
NewHandler create a new ProfilingHandler which serves runtime profiling data according to the given context path
func (*ProfilingHandler) ServeHTTP ¶
func (h *ProfilingHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
func (*ProfilingHandler) SetEnabled ¶
func (h *ProfilingHandler) SetEnabled(enabled bool) (old bool)
type ProfilingServer ¶
type ProfilingServer struct {
*http.Server
*ProfilingHandler
}
func NewProfilingServer ¶
func NewProfilingServer() *ProfilingServer
NewServer creates a new http server that exposes profiling data on the default profiling port
Click to show internal directories.
Click to hide internal directories.