telemetry

package
v0.18.1 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ConnLabels           = []string{"name"}
	CounterLabels        = []string{"name", "direction"}
	AllocActiveGauge     prometheus.GaugeFunc
	ListenerPacketsTotal *prometheus.CounterVec
	ListenerBytesTotal   *prometheus.CounterVec
	ListenerConnsTotal   *prometheus.CounterVec
	ListenerConnsActive  *prometheus.GaugeVec
	ClusterPacketsTotal  *prometheus.CounterVec
	ClusterBytesTotal    *prometheus.CounterVec
)

Functions

func AddConnection added in v0.11.3

func AddConnection(n string, c ConnType)

func Close added in v0.11.3

func Close()

func IncrementBytes added in v0.11.3

func IncrementBytes(n string, c ConnType, d Direction, count uint64)

func IncrementPackets added in v0.11.3

func IncrementPackets(n string, c ConnType, d Direction, count uint64)

func Init added in v0.11.3

func Init()

func RegisterAllocationMetric added in v0.18.1

func RegisterAllocationMetric(log logging.LeveledLogger, GetAllocationCount func() float64)

func SubConnection added in v0.11.3

func SubConnection(n string, c ConnType)

func UnregisterAllocationMetric added in v0.18.1

func UnregisterAllocationMetric(log logging.LeveledLogger)

Types

type Conn added in v0.11.3

type Conn struct {
	net.Conn
	// contains filtered or unexported fields
}

Conn is a net.Conn that knows how to report to Prometheus.

func NewConn added in v0.11.3

func NewConn(c net.Conn, n string, t ConnType) *Conn

NewConn allocates a stats conn that knows its name and type.

func (*Conn) Close added in v0.11.3

func (c *Conn) Close() error

Close closes the Conn.

func (*Conn) Read added in v0.11.3

func (c *Conn) Read(b []byte) (n int, err error)

Read reads from the Conn.

func (*Conn) Write added in v0.11.3

func (c *Conn) Write(b []byte) (n int, err error)

Write writes to the Conn.

type ConnType added in v0.11.3

type ConnType int

ConnType species whether a conn stat was collected at a listener or a cluster.

const (
	ListenerType ConnType = iota + 1
	ClusterType
)

func (ConnType) String added in v0.11.3

func (c ConnType) String() string

String returns a string representation for a ConnType.

type Direction added in v0.11.3

type Direction int

Direction species whether a conn stat applies in the sender or a receiving direction from the standpoint of STUNner.

const (
	Incoming Direction = iota + 1
	Outgoing
)

func (Direction) String added in v0.11.3

func (d Direction) String() string

String returns a string representation for a Direction.

type Listener added in v0.11.3

type Listener struct {
	net.Listener
	// contains filtered or unexported fields
}

Listener is a net.Listener that knows how to report to Prometheus.

func NewListener added in v0.11.3

func NewListener(l net.Listener, n string, t ConnType) *Listener

NewListener creates a net.Listener that knows its name and type.

func (*Listener) Accept added in v0.11.3

func (l *Listener) Accept() (net.Conn, error)

Accept accepts a new connection on a Listener.

type PacketConn added in v0.11.3

type PacketConn struct {
	net.PacketConn
	// contains filtered or unexported fields
}

PacketConn is a net.PacketConn that knows how to report to Prometheus.

func NewPacketConn added in v0.11.3

func NewPacketConn(c net.PacketConn, n string, t ConnType) *PacketConn

NewPacketConn decorates a PacketConnn with metric reporting.

func (*PacketConn) Close added in v0.11.3

func (c *PacketConn) Close() error

ReadFrom reads from the PacketConn. WriteTo writes to the PacketConn. Close closes the PacketConn.

func (*PacketConn) ReadFrom added in v0.11.3

func (c *PacketConn) ReadFrom(p []byte) (n int, addr net.Addr, err error)

ReadFrom reads from the PacketConn.

func (*PacketConn) WriteTo added in v0.11.3

func (c *PacketConn) WriteTo(p []byte, addr net.Addr) (n int, err error)

WriteTo writes to the PacketConn.

Jump to

Keyboard shortcuts

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