profiling

package
v0.1.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidProfilingPort occurs when the port in the config is invalid.
	ErrInvalidProfilingPort = errors.New("invalid port number for profiling server")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Port        int
	EnablePprof bool
}

Config is the configuration for creating a Server instance.

func (*Config) Validate

func (c *Config) Validate() error

Validate validates the port number.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server serves information for profiling, such as metrics and pprof information.

func NewServer

func NewServer(conf *Config) *Server

NewServer creates an instance of Server.

func (*Server) Handle

func (s *Server) Handle(pattern string, handler http.Handler)

Handle handles the given handler.

func (*Server) Shutdown

func (s *Server) Shutdown(graceful bool)

Shutdown closes the server.

func (*Server) Start

func (s *Server) Start() error

Start starts the server.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL