metrics

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metrics

type Metrics struct {
	metric.Meter

	TransferBytesSent  metric.Int64Counter
	TransferBytesRecv  metric.Int64Counter
	AuthenticationTime metric.Float64Histogram
	PeerStoreTime      metric.Float64Histogram
	// contains filtered or unexported fields
}

func NewMetrics

func NewMetrics(ctx context.Context, meter metric.Meter) (*Metrics, error)

func (*Metrics) PeerActivity

func (m *Metrics) PeerActivity(peerID string)

PeerActivity increases the active connections

func (*Metrics) PeerConnected

func (m *Metrics) PeerConnected(id string)

PeerConnected increments the number of connected peers and increments number of idle connections

func (*Metrics) PeerDisconnected

func (m *Metrics) PeerDisconnected(id string)

PeerDisconnected decrements the number of connected peers and decrements number of idle or active connections

func (*Metrics) RecordAuthenticationTime added in v0.30.2

func (m *Metrics) RecordAuthenticationTime(duration time.Duration)

RecordAuthenticationTime measures the time taken for peer authentication

func (*Metrics) RecordPeerStoreTime added in v0.30.2

func (m *Metrics) RecordPeerStoreTime(duration time.Duration)

RecordPeerStoreTime measures the time to store the peer in map

Jump to

Keyboard shortcuts

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