metrics

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	Listener net.Listener
	// contains filtered or unexported fields
}

Server is the monitoring endpoint. The monitoring endpoint provides counters for the service and a resource to do live traces of a running service. Overall performance is affected by the trace so use with caution on running systems under load.

func NewMonitoringServer

func NewMonitoringServer(endpoint string) (*Server, error)

NewMonitoringServer creates a new monitoring endpoint

func (*Server) ListenAddress

func (s *Server) ListenAddress() net.Addr

ListenAddress returns the external reachable address for the monitoring service. If it is listening on the loopback adapter the loopback address is returned.

func (*Server) ServerURL

func (s *Server) ServerURL() string

ServerURL is the URL for the server

func (*Server) SetStatus

func (s *Server) SetStatus(httpStatus int)

SetStatus sets the health status that is reported, ie http.StatusOK or http.StatusServiceUnavailable

func (*Server) Shutdown

func (s *Server) Shutdown() error

Shutdown stops the server. There is a 2 second timeout.

func (*Server) Start

func (s *Server) Start() error

Start launches the server

Jump to

Keyboard shortcuts

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