Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Namespace is the metrics namespace //todo: figure out if this can be used better. Namespace = "spacemesh" // MetricsSubsystem is a subsystem shared by all metrics exposed by this // package. MetricsSubsystem = "p2p" // ProtocolLabel holds the name we use to add a protocol label value ProtocolLabel = "protocol" // PeerIdLabel holds the name we use to add a protocol label value PeerIdLabel = "peer_id" )
Variables ¶
View Source
var ( // PropagationQueueLen is the current size of the gossip queue PropagationQueueLen = mt.NewGauge("propagate_queue_len", MetricsSubsystem, "Number of messages in the gossip queue", nil) // QueueLength is the current size of protocol queues QueueLength = mt.NewGauge("protocol_queue_len", MetricsSubsystem, "len of protocol queues", []string{ProtocolLabel}) )
View Source
var ( // OutboundPeers is the number of outbound peers we have connected OutboundPeers = totalPeers.With(typeLabel, "outbound") // InboundPeers is the number of inbound peers we have connected InboundPeers = totalPeers.With(typeLabel, "inbound") // PeerRecv is the num of bytes received from peer PeerRecv = prometheus.NewCounterFrom(stdprometheus.CounterOpts{ Namespace: Namespace, Subsystem: MetricsSubsystem, Name: "peer_receive_bytes_total", Help: "Number of bytes received from a given peer.", }, []string{PeerIdLabel}) // PeerSend is the num of bytes sent to peer PeerSend metrics.Counter = prometheus.NewCounterFrom(stdprometheus.CounterOpts{ Namespace: Namespace, Subsystem: MetricsSubsystem, Name: "peer_send_bytes_total", Help: "Number of bytes sent to a given peer.", }, []string{PeerIdLabel}) // NewGossipMessages is a metric for newly received gossip messages NewGossipMessages = totalGossipMessages.With(messageTypeLabel, "new") // OldGossipMessages is a metric for old messages received (duplicates) OldGossipMessages = totalGossipMessages.With(messageTypeLabel, "old") // InvalidGossipMessages is a metric for invalid messages received InvalidGossipMessages = totalGossipMessages.With(messageTypeLabel, "invalid") // AddrbookSize is the current size of the discovery AddrbookSize = prometheus.NewGaugeFrom(stdprometheus.GaugeOpts{ Namespace: Namespace, Subsystem: MetricsSubsystem, Name: "addrbook_size", Help: "Number of peers in the discovery", }, []string{}) )
TotalPeers is the total number of peers we have connected
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.