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 ¶
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 ¶
func (c *ControlMsgMetricsInspector) Name() string
Name returns the name of the rpc inspector.
func (*ControlMsgMetricsInspector) ObserveRPC ¶
func (c *ControlMsgMetricsInspector) ObserveRPC(req *ObserveRPCMetricsRequest) error
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
Click to show internal directories.
Click to hide internal directories.