Documentation ¶
Index ¶
- Variables
- func AddConnection(n string, c ConnType)
- func Close()
- func IncrementBytes(n string, c ConnType, d Direction, count uint64)
- func IncrementPackets(n string, c ConnType, d Direction, count uint64)
- func Init()
- func RegisterAllocationMetric(log logging.LeveledLogger, GetAllocationCount func() float64)
- func SubConnection(n string, c ConnType)
- func UnregisterAllocationMetric(log logging.LeveledLogger)
- type Conn
- type ConnType
- type Direction
- type Listener
- type PacketConn
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 IncrementBytes ¶ added in v0.11.3
func IncrementPackets ¶ added in v0.11.3
func RegisterAllocationMetric ¶ added in v0.18.1
func RegisterAllocationMetric(log logging.LeveledLogger, GetAllocationCount func() float64)
func SubConnection ¶ added in v0.11.3
func UnregisterAllocationMetric ¶ added in v0.18.1
func UnregisterAllocationMetric(log logging.LeveledLogger)
Types ¶
type Conn ¶ added in v0.11.3
Conn is a net.Conn that knows how to report to Prometheus.
type ConnType ¶ added in v0.11.3
type ConnType int
ConnType species whether a conn stat was collected at a listener or a cluster.
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.
type Listener ¶ added in v0.11.3
Listener is a net.Listener that knows how to report to Prometheus.
func NewListener ¶ added in v0.11.3
NewListener creates a net.Listener that knows its name and type.
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.
Click to show internal directories.
Click to hide internal directories.