proberlist

package
v0.0.0-...-6bf76cd Latest Latest
Warning

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

Go to latest
Published: May 24, 2021 License: Apache-2.0 Imports: 12 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HtmlWriter

type HtmlWriter interface {
	WriteHtml(writer io.Writer)
}

HtmlWriter defines a type that can write a HTML snippet about itself.

type ProberList

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

ProberList defines a type which manages a list of Probers.

func New

func New(proberPath string) *ProberList

New returns a new ProberList. Only one should be created per application. Metrics showing the operation of the Probers (not the metrics that the Probers collect) will be placed under proberPath.

func (*ProberList) Add

func (pl *ProberList) Add(registerProber RegisterProber, path string,
	probeInterval uint8)

Add registers a new RegisterProber. The path for the metrics for the Prober is given by path. Its Register method is called once. The preferred probe interval in seconds is given by probeInterval. If registerProber is nil then nothing is done.

func (*ProberList) CreateAndAdd

func (pl *ProberList) CreateAndAdd(registerFunc RegisterFunc, path string,
	probeInterval uint8)

CreateAndAdd registers a new Prober which is created by the registerFunc. The path for the metrics for the Prober is given by path. The preferred probe interval in seconds is given by probeInterval.

func (*ProberList) RequestWriteHtml

func (pl *ProberList) RequestWriteHtml(writer io.Writer, req *http.Request)

RequestWriteHtml will write HTML snippets to writer. Each Prober that implements the RequestHtmlWriter interface will have it's RequestWriteHtml method called. These methods are called in the order in which the Probers were added.

func (*ProberList) StartProbing

func (pl *ProberList) StartProbing(defaultProbeInterval uint,
	logger log.Logger)

StartProbing creates one or more goroutines which will run probes in an infinite loop. The default probe interval in seconds is given by defaultProbeInterval. The logger will be used to log problems.

func (*ProberList) WriteHtml

func (pl *ProberList) WriteHtml(writer io.Writer)

WriteHtml will write HTML snippets to writer. Each Prober that implements the HtmlWriter interface will have it's WriteHtml method called. These methods are called in the order in which the Probers were added.

type RegisterFunc

type RegisterFunc func(dir *tricorder.DirectorySpec) prober.Prober

type RegisterProber

type RegisterProber interface {
	prober.Prober
	Register(dir *tricorder.DirectorySpec) error
}

RegisterProber defines a type that can register a Prober.

Jump to

Keyboard shortcuts

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