inspector

package
v0.32.10-master-storeh... Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultControlMsgMetricsInspectorNumberOfWorkers default number of workers for the inspector component.
	DefaultControlMsgMetricsInspectorNumberOfWorkers = 1
	// DefaultControlMsgMetricsInspectorQueueCacheSize is the default size of the message queue.
	DefaultControlMsgMetricsInspectorQueueCacheSize = 100
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ControlMsgMetricsInspector

type ControlMsgMetricsInspector struct {
	component.Component

	// NumberOfWorkers number of component workers.
	NumberOfWorkers int
	// contains filtered or unexported fields
}

ControlMsgMetricsInspector a GossipSub RPC inspector that will observe incoming RPC's and collect metrics related to control messages.

func NewControlMsgMetricsInspector

func NewControlMsgMetricsInspector(logger zerolog.Logger, metricsObserver p2p.GossipSubControlMetricsObserver, numberOfWorkers int, heroStoreOpts ...queue.HeroStoreConfigOption) *ControlMsgMetricsInspector

NewControlMsgMetricsInspector returns a new *ControlMsgMetricsInspector

func (*ControlMsgMetricsInspector) Inspect

func (c *ControlMsgMetricsInspector) Inspect(from peer.ID, rpc *pubsub.RPC) error

Inspect submits a request to the worker pool to observe metrics for the rpc. All errors returned from this function can be considered benign.

func (*ControlMsgMetricsInspector) Name

Name returns the name of the rpc inspector.

func (*ControlMsgMetricsInspector) ObserveRPC

ObserveRPC collects metrics for the rpc. No error is ever returned from this func.

type ObserveRPCMetricsRequest

type ObserveRPCMetricsRequest struct {
	// Nonce adds random value so that when msg req is stored on hero store a unique ID can be created from the struct fields.
	Nonce []byte
	// From the sender of the RPC.
	From peer.ID
	// contains filtered or unexported fields
}

ObserveRPCMetricsRequest represents a request to capture metrics for the provided RPC

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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