Documentation
¶
Index ¶
- type Callbacks
- type ConnType
- type Counters
- type Direction
- type Telemetry
- func (t *Telemetry) AddConnection(n string, c ConnType)
- func (t *Telemetry) Close() error
- func (t *Telemetry) Counters(n string, c ConnType) *Counters
- func (t *Telemetry) Ctx() context.Context
- func (t *Telemetry) IncrementBytes(n string, c ConnType, d Direction, count uint64)
- func (t *Telemetry) IncrementPackets(n string, c ConnType, d Direction, count uint64)
- func (t *Telemetry) Stats(n string, c ConnType) stnrv2.DirStat
- func (t *Telemetry) SubConnection(n string, c ConnType)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Callbacks ¶
type Callbacks struct {
// GetAllocationCount should map to the total allocation counter of the server.
GetAllocationCount func() int64
// GetBuildInfo returns the version of the binary, exported as the build info metric.
GetBuildInfo func() buildinfo.BuildInfo
}
Callbacks lets the caller to define various callbacks for reporting active metrics from an object that cannot be reached from this subpackage. This interface allows to easily add new metric reporters.
type ConnType ¶
type ConnType int
ConnType specifies whether a conn stat was collected at a listener or a cluster.
type Counters ¶
type Counters struct {
// contains filtered or unexported fields
}
Counters counts the traffic of one listener or cluster. It builds the metric attributes of both directions once, so the per-packet path neither allocates nor hashes the name.
type Direction ¶
type Direction int
Direction specifies whether a conn stat applies in the sender or a receiving direction from the standpoint of STUNner.
type Telemetry ¶
type Telemetry struct {
sdkmetric.Reader
// Metrics instruments
ListenerPacketsCounter metric.Int64Counter
ListenerBytesCounter metric.Int64Counter
ListenerConnsCounter metric.Int64Counter
ListenerConnsGauge metric.Int64UpDownCounter
ClusterPacketsCounter metric.Int64Counter
ClusterBytesCounter metric.Int64Counter
AllocationsGauge metric.Int64ObservableGauge
BuildInfoGauge metric.Int64ObservableGauge
// contains filtered or unexported fields
}
func (*Telemetry) AddConnection ¶
func (*Telemetry) Close ¶
Close cleanly shuts down the meter provider and blocks until the shutdown cycle is finished or a timeout expires.
func (*Telemetry) Counters ¶
Counters returns the traffic counters of a listener (ListenerType) or a cluster (ClusterType).
func (*Telemetry) IncrementBytes ¶
func (*Telemetry) IncrementPackets ¶
func (*Telemetry) Stats ¶
Stats returns the traffic a listener (ListenerType) or a cluster (ClusterType) carried, in user space and, as the offload reporter adds it, in the kernel.