metrics

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: LGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrServerEndedUnexpectedly = fmt.Errorf("metrics server exited unexpectedly")
	ErrServerStopTimeout       = fmt.Errorf("metrics server exit timeout")
)

Functions

This section is empty.

Types

type IntervalConfig

type IntervalConfig struct {
	Publish  bool
	Interval time.Duration
}

IntervalConfig for interval collection

func NewIntervalConfig

func NewIntervalConfig(publish bool) IntervalConfig

NewIntervalConfig is constructor for IntervalConfig, and uses default metrics interval

type Logger added in v0.8.0

type Logger interface {
	Info(s string)
	Warn(s string)
	Error(s string)
	Infof(format string, args ...interface{})
}

Logger logs formatted strings at the different log levels.

type Server

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

Server is a metrics http server

func NewServer

func NewServer(address string) (s *Server)

NewServer is a constructor for metrics server

func (*Server) Start

func (s *Server) Start(address string) (err error)

Start will start a dedicated metrics server at the given address.

func (*Server) Stop

func (s *Server) Stop() (err error)

Stop will stop the metrics server

Jump to

Keyboard shortcuts

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