profiling

package
v0.4.29 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package profiling provides profiling server.

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
Package prometheus provides a Prometheus metrics exporter.
Package prometheus provides a Prometheus metrics exporter.

Jump to

Keyboard shortcuts

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