metrics

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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) ClosedStream

func (conns *Connections) ClosedStream(network.Network, network.Stream)

ClosedStream is called when a stream closed

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) OpenedStream

func (conns *Connections) OpenedStream(network.Network, network.Stream)

OpenedStream is called when a stream opened

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

Jump to

Keyboard shortcuts

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