diagnostics

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2022 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogError added in v0.4.0

func LogError(msg string, err error)

LogError logs a single error it uses LogPublishErrors in the background.

func LogPublishErrors added in v0.4.0

func LogPublishErrors(msg string, errorList []error)

LogPublishErrors will log errors for a message. This method is mostly used for debug messages from rpcBus.Publish return errList.

func RegisterWireMsg added in v0.4.0

func RegisterWireMsg(networkType string, rawdata []byte)

RegisterWireMsg is a util for registering a wire message to a network-monitor. service in a zero-overhead manner. Under the hood, it encodes a json-rpc with following fields msg_id, node_address (or node id), receive timestamp in, networkType is the type of the network (Kadcst, Gossip are allowed valued), rawdata is the wire message data.

Types

type NoteArgs added in v0.4.0

type NoteArgs struct {
	MsgID, Addr, MsgType string
	Recv_at              uint64
}

NoteArgs rpc request args.

type NoteRequest added in v0.4.0

type NoteRequest struct {
	Method string     `json:"method"`
	Params []NoteArgs `json:"params"`
	ID     string     `json:"id"`
}

NoteRequest rpc request.

func (*NoteRequest) Say added in v0.4.0

func (h *NoteRequest) Say(p NoteArgs) *NoteRequest

Say rpc method.

type Profile

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

Profile represents the cpu or memory profile sampled at regular intervals.

func NewProfile

func NewProfile(name string, n, d uint, start bool) Profile

NewProfile returns a new instance of a Profile.

type ProfileSet

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

ProfileSet allows fetching program samples of different types. It could be handful if node user observes problematic situation or any type of inefficiency. In most cases, it will allow a developer to catch a perf issue (Memory, CPU or concurrency inefficiency) at development phase. As support for periodical sample fetching is added, the tool could enable 'continuous profiling' with negligible overhead.

See also func profile.loop() for a few examples of use.

func NewProfileSet

func NewProfileSet() ProfileSet

NewProfileSet creates and starts ProfileSet from a set of settings strings.

func (ProfileSet) Close

func (ps ProfileSet) Close()

Close the internal quit channel.

func (*ProfileSet) Listen

func (ps *ProfileSet) Listen(rpc *rpcbus.RPCBus)

Listen listens rpcbus commands to allow enabling/disabling any profile in runtime (e.g via rpc).

func (*ProfileSet) Spawn

func (ps *ProfileSet) Spawn(p Profile) error

Spawn a ProfileSet from a Profile.

Jump to

Keyboard shortcuts

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