Documentation ¶
Index ¶
- type HtmlWriter
- type ProberList
- func (pl *ProberList) Add(registerProber RegisterProber, path string, probeInterval uint8)
- func (pl *ProberList) CreateAndAdd(registerFunc RegisterFunc, path string, probeInterval uint8)
- func (pl *ProberList) RequestWriteHtml(writer io.Writer, req *http.Request)
- func (pl *ProberList) StartProbing(defaultProbeInterval uint, logger log.Logger)
- func (pl *ProberList) WriteHtml(writer io.Writer)
- type RegisterFunc
- type RegisterProber
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HtmlWriter ¶
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.