profiling

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: May 10, 2022 License: Apache-2.0 Imports: 8 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  `yaml:"Port"`
	EnablePprof bool `yaml:"EnablePprof"`
}

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, metrics *prometheus.Metrics) *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 shut down 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