diagnostics

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2021 License: MIT Imports: 6 Imported by: 0 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package diagnostics provides some tools useful for gathering and exposing arbitrary diagnositcs information for external monitoring tools.

Possible usage: integration nodes list into dashboard.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Registry added in v1.5.0

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

Registry performs all management of diagnostic. Specifically, it allows to registering new diagnostics sources and exposing them through the diagnostics server.

func NewRegistry

func NewRegistry() *Registry

NewRegistry creates a new metrics registry.

func (*Registry) EnableServer added in v1.5.0

func (r *Registry) EnableServer(port int)

EnableServer enables the diagnostics server on the given port. Data will be exposed on `/diagnostics` path in JSON format.

func (*Registry) RegisterSource added in v1.5.0

func (r *Registry) RegisterSource(name string, source func() string)

RegisterSource registers diagnostics source callback with a given name. Name will be used as a key and callback result as a value in JSON object during composing diagnostics JSON. Note: function will override existing diagnostics source on attempt to register another one with the same name.

Jump to

Keyboard shortcuts

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