prober

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

Functions

func DebugOutput

func DebugOutput(logBuffer *bytes.Buffer, registry *prometheus.Registry) string

DebugOutput returns plaintext debug output for a probe.

func Handler

func Handler(w http.ResponseWriter, r *http.Request, c *config.Config, logger log.Logger,
	rh *ResultHistory, timeoutOffset float64,
	params url.Values)

Types

type ProbeFn

type ProbeFn func(ctx context.Context, sbc *sonus.SBC, cfg *config.Config, registry *prometheus.Registry, logger log.Logger) error

A ProbeFn calls the SBC and adds its metrics to the registry

type Result

type Result struct {
	Id          int64
	ModuleName  string
	Target      string
	DebugOutput string
	Success     bool
}

Result contains the result of the execution of a probe

type ResultHistory

type ResultHistory struct {
	MaxResults uint
	// contains filtered or unexported fields
}

ResultHistory contains two history slices: `results` contains most recent `maxResults` results. After they expire out of `results`, failures will be saved in `preservedFailedResults`. This ensures that we are always able to see debug information about recent failures.

func (*ResultHistory) Add

func (rh *ResultHistory) Add(moduleName, target, debugOutput string, success bool)

Add a result to the history.

func (*ResultHistory) Get

func (rh *ResultHistory) Get(id int64) *Result

Get returns a given result.

func (*ResultHistory) List

func (rh *ResultHistory) List() []*Result

List returns a list of all results.

Jump to

Keyboard shortcuts

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