Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIHealthArgs ¶ added in v1.2.1
type APIHealthArgs struct{}
APIHealthArgs are the arguments for Health
type APIHealthClientReply ¶ added in v1.6.2
type APIHealthServerReply ¶ added in v1.6.2
type APIHealthServerReply struct { Checks map[string]health.Result `json:"checks"` Healthy bool `json:"healthy"` }
APIHealthReply is the response for Health
type Client ¶ added in v1.0.6
type Client struct {
// contains filtered or unexported fields
}
Client for Avalanche Health API Endpoint
func (*Client) AwaitHealthy ¶ added in v1.0.6
AwaitHealthy queries the Health endpoint [checks] times, with a pause of [interval] in between checks and returns early if Health returns healthy
func (*Client) Health ¶ added in v1.2.1
func (c *Client) Health() (*APIHealthClientReply, error)
Health returns a health check on the Avalanche node
type Result ¶ added in v1.6.2
type Result struct { // the details of task Result - may be nil Details interface{} `json:"message,omitempty"` // the error returned from a failed health check - an empty string when successful Error string `json:"error,omitempty"` // the time of the last health check Timestamp time.Time `json:"timestamp"` // the execution duration of the last check Duration time.Duration `json:"duration,omitempty"` // the number of failures that occurred in a row ContiguousFailures int64 `json:"contiguousFailures"` // the time of the initial transitional failure TimeOfFirstFailure *time.Time `json:"timeOfFirstFailure"` }
Result represents the output of a health check execution.
type Service ¶ added in v1.2.1
type Service interface { healthlib.Service Handler() (*common.HTTPHandler, error) }
Service wraps a healthlib.Service. Handler() returns a handler that handles incoming HTTP API requests. We have this in a separate package from healthlib to avoid a circular import where this service imports snow/engine/common but that package imports healthlib.Checkable
func NewNoOpService ¶ added in v1.1.1
func NewNoOpService() Service
NewNoOpService returns a NoOp version of health check for when the Health API is disabled
func NewService ¶
func NewService(checkFreq time.Duration, log logging.Logger, namespace string, registry prometheus.Registerer) (Service, error)