Documentation ¶
Index ¶
- type Connections
- func (conns *Connections) ClosedStream(network.Network, network.Stream)
- func (conns *Connections) Connected(network.Network, network.Conn)
- func (conns *Connections) Disconnected(network.Network, network.Conn)
- func (conns *Connections) Listen(network.Network, multiaddr.Multiaddr)
- func (conns *Connections) ListenClose(network.Network, multiaddr.Multiaddr)
- func (conns *Connections) OpenedStream(network.Network, network.Stream)
- func (conns *Connections) ResetNumConnections() uint32
- func (conns *Connections) ResetNumDisconnections() uint32
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