Documentation
¶
Index ¶
- Constants
- type Logger
- type Option
- type Server
- func (s *Server) AttachRoutes(r gin.IRoutes)
- func (s *Server) RunDailyCleanup(retention time.Duration)
- func (s *Server) StartBlockProfiling(rate int) error
- func (s *Server) StartBlocking() error
- func (s *Server) StartCPUProfiling(seconds int) error
- func (s *Server) StartMutexProfiling(fraction int) error
- func (s *Server) StartNonBlocking() error
- func (s *Server) Stop()
- func (s *Server) StopBlockProfiling() error
- func (s *Server) StopCPUProfiling() error
- func (s *Server) StopMutexProfiling() error
- func (s *Server) WriteGoroutines() (string, error)
- func (s *Server) WriteHeap() (string, error)
Constants ¶
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger interface {
Debug(msg string, args ...any)
Enabled(ctx context.Context, level slog.Level) bool
Error(msg string, args ...any)
Handler() slog.Handler
Info(msg string, args ...any)
Log(ctx context.Context, level slog.Level, msg string, args ...any)
LogAttrs(ctx context.Context, level slog.Level, msg string, attrs ...slog.Attr)
Warn(msg string, args ...any)
With(args ...any) *slog.Logger
WithGroup(name string) *slog.Logger
}
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) AttachRoutes ¶
AttachRoutes attaches a set of endpoints to control profiling and to download snapshots.
func (*Server) RunDailyCleanup ¶
RunDailyCleanup launches a goroutine that removes files older than retention duration.
func (*Server) StartBlockProfiling ¶
StartBlockProfiling enables block profiling with rate (events/sample). rate==0 disables.
func (*Server) StartBlocking ¶
func (*Server) StartCPUProfiling ¶
StartCPUProfiling starts a CPU profile for `seconds` seconds. If seconds<=0 uses 30s.
func (*Server) StartMutexProfiling ¶
StartMutexProfiling sets mutex profile fraction. fraction==0 disables.
func (*Server) StartNonBlocking ¶
func (*Server) StopBlockProfiling ¶
StopBlockProfiling disables block profiling.
func (*Server) StopCPUProfiling ¶
StopCPUProfiling stops CPU profiling. It is safe to call multiple times.
func (*Server) StopMutexProfiling ¶
StopMutexProfiling disables mutex profiling.
func (*Server) WriteGoroutines ¶
WriteGoroutines writes the goroutine profile (stack traces) to a file, returns path.
