metrics

package
v1.0.17 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2023 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidValueForTimeToLiveParam = errors.New("invalid value for the time-to-live parameter")

ErrInvalidValueForTimeToLiveParam signals that an invalid value for the time-to-live parameter was provided

Functions

func NewDisabledConnectionsWatcher

func NewDisabledConnectionsWatcher() *disabledConnectionsWatcher

NewDisabledConnectionsWatcher returns a disabled ConnectionWatcher implementation

func NewPrintConnectionsWatcher

func NewPrintConnectionsWatcher(timeToLive time.Duration) (*printConnectionsWatcher, error)

NewPrintConnectionsWatcher creates a new

Types

type Connections

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

Connections is a metric that counts connections and disconnections done by the host implementation

func NewConnections

func NewConnections() *Connections

NewConnections returns a new connsDisconnsMetric instance

func (*Connections) Connected

func (conns *Connections) Connected(network.Network, network.Conn)

Connected is called when a connection opened. It increments the numConnections counter

func (*Connections) Disconnected

func (conns *Connections) Disconnected(network.Network, network.Conn)

Disconnected is called when a connection closed it increments the numDisconnections counter

func (*Connections) Listen

func (conns *Connections) Listen(network.Network, multiaddr.Multiaddr)

Listen is called when network starts listening on an addr

func (*Connections) ListenClose

func (conns *Connections) ListenClose(network.Network, multiaddr.Multiaddr)

ListenClose is called when network stops listening on an addr

func (*Connections) ResetNumConnections

func (conns *Connections) ResetNumConnections() uint32

ResetNumConnections resets the numConnections counter returning the previous value

func (*Connections) ResetNumDisconnections

func (conns *Connections) ResetNumDisconnections() uint32

ResetNumDisconnections resets the numDisconnections counter returning the previous value

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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