probe

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ProbeModularName = strings.ToLower("Probe")
)

Functions

func Combine

func Combine(probes ...coreprober.Prober) coreprober.Prober

Combine folds given probes into one, reflects their statuses in a thread-safe way.

Types

type HTTPProbe

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

HTTPProbe represents health and readiness status of given component, and provides HTTP integration.

func NewHTTPProbe

func NewHTTPProbe() *HTTPProbe

NewHTTPProbe returns HTTPProbe representing readiness and liveness of given component.

func (*HTTPProbe) Healthy

func (p *HTTPProbe) Healthy()

Healthy sets components status to healthy.

func (*HTTPProbe) HealthyHandler

func (p *HTTPProbe) HealthyHandler() http.HandlerFunc

HealthyHandler returns an HTTP Handler which responds health checks.

func (*HTTPProbe) IsHealthy

func (p *HTTPProbe) IsHealthy() bool

IsHealthy returns true if component is healthy.

func (*HTTPProbe) IsReady

func (p *HTTPProbe) IsReady() bool

IsReady returns true if component is ready.

func (*HTTPProbe) Ready

func (p *HTTPProbe) Ready()

Ready sets components status to ready.

func (*HTTPProbe) ReadyHandler

func (p *HTTPProbe) ReadyHandler() http.HandlerFunc

ReadyHandler returns an HTTP handler which responds readiness checks.

func (*HTTPProbe) Unhealthy

func (p *HTTPProbe) Unhealthy(err error)

Unhealthy sets components status to unhealthy with given error as a cause.

func (*HTTPProbe) Unready

func (p *HTTPProbe) Unready(err error)

Unready sets components status to unready with given error as a cause.

type InstrumentationProbe

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

InstrumentationProbe stores instrumentation state of Probe. This is created with an intention to combine with other Probe's using prober.Combine.

func NewInstrumentation

func NewInstrumentation() *InstrumentationProbe

NewInstrumentation returns InstrumentationProbe records readiness and healthiness for given module.

func (*InstrumentationProbe) Healthy

func (p *InstrumentationProbe) Healthy()

Healthy records the module status when Healthy is called, if combined with other Probes.

func (*InstrumentationProbe) Ready

func (p *InstrumentationProbe) Ready()

Ready records the module status when Ready is called, if combined with other Probes.

func (*InstrumentationProbe) Unhealthy

func (p *InstrumentationProbe) Unhealthy(err error)

Unhealthy records the module status when UnHealthy is called, if combined with other Probes.

func (*InstrumentationProbe) Unready

func (p *InstrumentationProbe) Unready(err error)

Unready records the module status when Unready is called, if combined with other Probes.

type Probe

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

PProf is used to analyse the performance sp service

func NewProbe

func NewProbe(address string, probe *HTTPProbe) *Probe

NewProbe returns an instance of probe

func (*Probe) Name

func (p *Probe) Name() string

Name describes probe service name

func (*Probe) ReleaseResource

func (p *Probe) ReleaseResource(ctx context.Context, scope corercmgr.ResourceScopeSpan)

func (*Probe) ReserveResource

func (p *Probe) ReserveResource(ctx context.Context, state *corercmgr.ScopeStat) (corercmgr.ResourceScopeSpan, error)

func (*Probe) Start

func (p *Probe) Start(ctx context.Context) error

Start HTTP server

func (*Probe) Stop

func (p *Probe) Stop(ctx context.Context) error

Stop HTTP server

Jump to

Keyboard shortcuts

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