metrics

package
v0.3.10-beta.2-trigger... Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// DroppedConnectionsValidationReject is incremented every time a
	// connection is dropped due to an ErrValidationReject result.
	DroppedConnectionsValidationReject = metrics.NewCounter(
		"dropped_connections_validation_reject",
		subsystem,
		"Connections dropped due to ErrValidationReject result",
		nil,
	).WithLabelValues()
)
View Source
var (
	// ProcessedMessagesDuration in nanoseconds to process a message. Labeled by protocol and result.
	ProcessedMessagesDuration = metrics.NewHistogramWithBuckets(
		"processed_messages_duration",
		subsystem,
		"Duration in nanoseconds to process a message",
		[]string{"protocol", "result"},
		prometheus.ExponentialBuckets(1_000_000, 4, 10),
	)
)

Functions

This section is empty.

Types

type BandwidthCollector added in v1.0.0

type BandwidthCollector struct{}

BandwidthCollector implement metrics.Reporter that keeps track of the number of messages sent and received per protocol.

func NewBandwidthCollector added in v1.0.0

func NewBandwidthCollector() *BandwidthCollector

NewBandwidthCollector creates a new BandwidthCollector.

func (*BandwidthCollector) GetBandwidthByPeer added in v1.0.0

func (b *BandwidthCollector) GetBandwidthByPeer() map[peer.ID]metrics.Stats

GetBandwidthByPeer mock returns the bandwidth for a given peer.

func (*BandwidthCollector) GetBandwidthByProtocol added in v1.0.0

func (b *BandwidthCollector) GetBandwidthByProtocol() map[protocol.ID]metrics.Stats

GetBandwidthByProtocol mock returns the bandwidth for a given protocol.

func (*BandwidthCollector) GetBandwidthForPeer added in v1.0.0

func (b *BandwidthCollector) GetBandwidthForPeer(peer.ID) metrics.Stats

GetBandwidthForPeer mock returns the bandwidth for a given peer.

func (*BandwidthCollector) GetBandwidthForProtocol added in v1.0.0

func (b *BandwidthCollector) GetBandwidthForProtocol(protocol.ID) metrics.Stats

GetBandwidthForProtocol mock returns the bandwidth for a given protocol.

func (*BandwidthCollector) GetBandwidthTotals added in v1.0.0

func (b *BandwidthCollector) GetBandwidthTotals() metrics.Stats

GetBandwidthTotals returns mock the total bandwidth used by the node.

func (*BandwidthCollector) LogRecvMessage added in v1.0.0

func (b *BandwidthCollector) LogRecvMessage(int64)

LogRecvMessage logs the message received from the peer.

func (*BandwidthCollector) LogRecvMessageStream added in v1.0.0

func (b *BandwidthCollector) LogRecvMessageStream(size int64, proto protocol.ID, p peer.ID)

LogRecvMessageStream logs the message that node received from the peer.

func (*BandwidthCollector) LogSentMessage added in v1.0.0

func (b *BandwidthCollector) LogSentMessage(int64)

LogSentMessage logs the message sent to the peer.

func (*BandwidthCollector) LogSentMessageStream added in v1.0.0

func (b *BandwidthCollector) LogSentMessageStream(size int64, proto protocol.ID, p peer.ID)

LogSentMessageStream logs the message node sent to the peer.

type ConnectionsMeeter added in v1.0.0

type ConnectionsMeeter struct{}

ConnectionsMeeter stores the number of connections for node. number of connections number of streams per each protocol histogram for server request durations for each protocol.

func NewConnectionsMeeter added in v1.0.0

func NewConnectionsMeeter() *ConnectionsMeeter

NewConnectionsMeeter returns a new ConnectionsMeeter.

func (*ConnectionsMeeter) ClosedStream added in v1.0.0

func (c *ConnectionsMeeter) ClosedStream(_ network.Network, str network.Stream)

ClosedStream called when a stream closed.

func (*ConnectionsMeeter) Connected added in v1.0.0

func (c *ConnectionsMeeter) Connected(network.Network, network.Conn)

Connected called when a connection opened.

func (*ConnectionsMeeter) Disconnected added in v1.0.0

func (c *ConnectionsMeeter) Disconnected(network.Network, network.Conn)

Disconnected called when a connection closed.

func (*ConnectionsMeeter) Listen added in v1.0.0

Listen called when network starts listening on an addr.

func (*ConnectionsMeeter) ListenClose added in v1.0.0

func (c *ConnectionsMeeter) ListenClose(network.Network, ma.Multiaddr)

ListenClose called when network stops listening on an addr.

func (*ConnectionsMeeter) OpenedStream added in v1.0.0

func (c *ConnectionsMeeter) OpenedStream(_ network.Network, str network.Stream)

OpenedStream called when a stream opened.

type GossipCollector added in v1.0.0

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

GossipCollector pubsub.RawTracer implementation total number of peers number of peers per each gossip protocol.

func NewGoSIPCollector added in v1.0.0

func NewGoSIPCollector() *GossipCollector

NewGoSIPCollector creates a new GossipCollector.

func (*GossipCollector) AddPeer added in v1.0.0

func (g *GossipCollector) AddPeer(id peer.ID, proto protocol.ID)

AddPeer is invoked when a new peer is added.

func (*GossipCollector) DeliverMessage added in v1.0.0

func (g *GossipCollector) DeliverMessage(msg *pubsub.Message)

DeliverMessage is invoked when a message is delivered.

func (*GossipCollector) DropRPC added in v1.0.0

func (g *GossipCollector) DropRPC(*pubsub.RPC, peer.ID)

DropRPC is invoked when an outbound RPC is dropped, typically because of a queue full.

func (*GossipCollector) DuplicateMessage added in v1.0.0

func (g *GossipCollector) DuplicateMessage(msg *pubsub.Message)

DuplicateMessage is invoked when a duplicate message is dropped.

func (*GossipCollector) Graft added in v1.0.0

func (g *GossipCollector) Graft(peer.ID, string)

Graft is invoked when a new peer is grafted on the mesh (gossipsub).

func (*GossipCollector) Join added in v1.0.0

func (g *GossipCollector) Join(string)

Join is invoked when a new topic is joined.

func (*GossipCollector) Leave added in v1.0.0

func (g *GossipCollector) Leave(string)

Leave is invoked when a topic is abandoned.

func (*GossipCollector) Prune added in v1.0.0

func (g *GossipCollector) Prune(peer.ID, string)

Prune is invoked when a peer is pruned from the message (gossipsub).

func (*GossipCollector) RecvRPC added in v1.0.0

func (g *GossipCollector) RecvRPC(*pubsub.RPC)

RecvRPC is invoked when an incoming RPC is received.

func (*GossipCollector) RejectMessage added in v1.0.0

func (g *GossipCollector) RejectMessage(*pubsub.Message, string)

RejectMessage is invoked when a message is Rejected or Ignored. The reason argument can be one of the named strings Reject*.

func (*GossipCollector) RemovePeer added in v1.0.0

func (g *GossipCollector) RemovePeer(id peer.ID)

RemovePeer is invoked when a peer is removed.

func (*GossipCollector) SendRPC added in v1.0.0

func (g *GossipCollector) SendRPC(*pubsub.RPC, peer.ID)

SendRPC is invoked when a RPC is sent.

func (*GossipCollector) ThrottlePeer added in v1.0.0

func (g *GossipCollector) ThrottlePeer(peer.ID)

ThrottlePeer is invoked when a peer is throttled by the peer gater.

func (*GossipCollector) UndeliverableMessage added in v1.0.0

func (g *GossipCollector) UndeliverableMessage(*pubsub.Message)

UndeliverableMessage is invoked when the consumer of Subscribe is not reading messages fast enough and the pressure release mechanism trigger, dropping messages.

func (*GossipCollector) ValidateMessage added in v1.0.0

func (g *GossipCollector) ValidateMessage(msg *pubsub.Message)

ValidateMessage is invoked when a message first enters the validation pipeline.

Jump to

Keyboard shortcuts

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