diagnosis

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2021 License: Apache-2.0 Imports: 0 Imported by: 3

Documentation

Overview

Package diagnosis provide support to register probe func that can get some infos to do diagnosis.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProbeFunc

type ProbeFunc func() interface{}

ProbeFunc is used to get probe data, it is usually a data dump func.

func WrapAsProbeFunc

func WrapAsProbeFunc(data interface{}) ProbeFunc

WrapAsProbeFunc is to wrap probe data as ProbeFunc, the data is some infos that you want to diagnosis, like config info.

type ProbeName

type ProbeName string

ProbeName is the name of probe.

const (
	// Common
	ChangeEventsKey ProbeName = "events"
	ServiceInfoKey  ProbeName = "service_info"
	OptionsKey      ProbeName = "options"

	// Client
	DestServiceKey ProbeName = "dest_service"
	ConnPoolKey    ProbeName = "conn_pool"
	RetryPolicyKey ProbeName = "retry_policy"
)

Keys below are probe info that has been registered by default. If you want to register other info, please use RegisterProbeFunc(ProbeName, ProbeFunc) to do that.

type Service

type Service interface {
	// RegisterProbeFunc is used to register ProbeFunc with probe name
	// ProbeFunc is usually a dump func that to dump info to do problem diagnosis,
	// eg: CBSuite.Dump(), s.RegisterProbeFunc(CircuitInfoKey, cbs.Dump)
	RegisterProbeFunc(ProbeName, ProbeFunc)
}

Service is the interface for debug service.

var NoopService Service = &noopService{}

NoopService is a empty implementation of Service. If you need diagnosis feature, specify Service through the option WithDiagnosisService of client and server.

Jump to

Keyboard shortcuts

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