metrics

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Namespace provides a common namespace for metrics.
	Namespace = "usocksd"
)

Variables

View Source
var (
	// Registry provides a common registry for metrics.
	Registry = prometheus.NewRegistry()
)

Functions

This section is empty.

Types

type Server

type Server struct {
	// Logger can be used to provide a custom logger.
	// If nil, the default logger is used.
	Logger *log.Logger

	// ShutdownTimeout is the maximum duration the server waits for
	// all connections to be closed before shutdown.
	//
	// Zero duration disables timeout.
	ShutdownTimeout time.Duration

	// Env is the environment where this server runs.
	//
	// The global environment is used if Env is nil.
	Env *well.Environment
	// contains filtered or unexported fields
}

Server implements a metrics server.

func (*Server) Serve

func (s *Server) Serve(ln net.Listener) error

Serve starts a goroutine to accept connections. This returns immediately. l will be closed when s.Env is canceled. See https://godoc.org/github.com/cybozu-go/well#Server.Serve

Jump to

Keyboard shortcuts

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