Documentation
¶
Overview ¶
Package connectiondiag holds shared interpretation for the connection counter API and MCP tools.
Index ¶
- Constants
- func AverageRTTMS(sum, samples uint64) uint32
- func LossPermille(lost, sent uint64) uint32
- func SupportsHysteria2Links2(protocol string, supportsLinks2 bool) bool
- func UnsupportedCounters(protocol string) []string
- func UnsupportedCountersForNode(protocol string, agentCaps []string) []string
- func UnsupportedDescription() string
Constants ¶
const Links2Capability = "links/2"
const VLESSUnknownKeysCapability = "vless-unknown-keys/1"
Variables ¶
This section is empty.
Functions ¶
func AverageRTTMS ¶ added in v0.1.57
AverageRTTMS returns the integer mean of the node's smoothed RTT samples, or zero when there were no samples.
func LossPermille ¶ added in v0.1.57
LossPermille returns packets declared lost per thousand sent, or zero when no packets were sent. The division avoids overflowing uint64 when the aggregate packet count is large.
func SupportsHysteria2Links2 ¶ added in v0.1.57
SupportsHysteria2Links2 reports whether this protocol/node pair can produce the close and path-quality fields.
func UnsupportedCounters ¶
UnsupportedCounters returns protocol-level counters this protocol does not report. A fresh slice keeps callers from mutating shared values. Hysteria2 and VLESS are treated as older agents unless their capability is supplied to UnsupportedCountersForNode.
func UnsupportedCountersForNode ¶ added in v0.1.57
UnsupportedCountersForNode also accounts for node-agent capabilities. links/2 is the Hysteria2-only close and path-quality contract, and vless-unknown-keys/1 enables the VLESS unknown-user-ID counter.
func UnsupportedDescription ¶
func UnsupportedDescription() string
UnsupportedDescription is the common note used by MCP descriptions and tests.
Types ¶
This section is empty.