Documentation
¶
Index ¶
Constants ¶
const ( // LAN kinds count a tun hub's peer-LAN routing: what the hub refused, // what it put into its table, and what it took out again. They are // counted by the hub's RIB, not by the packet path, because the RIB is // where those three decisions are actually made. KindLanRouted stats.Kind = 103 KindLanDenied stats.Kind = 104 KindLanWithdrawn stats.Kind = 105 )
LAN statistic kinds, defined here in x because core/ must stay untouched. Core uses 1-5; 101+ is x-private space.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Stats ¶
type Stats struct {
// contains filtered or unexported fields
}
Stats implements the stats.Stats interface using atomic counters. When resetTraffic is true, Get for KindInputBytes and KindOutputBytes atomically swaps the counter with zero, returning the value at the time of the call.
type StatsEvent ¶
type StatsEvent struct {
Kind string
Service string
Client string
TotalConns uint64
CurrentConns uint64
InputBytes uint64
OutputBytes uint64
TotalErrs uint64
}
StatsEvent carries a snapshot of all tracked statistics for a specific service and optional client. It implements observer.Event.
func (StatsEvent) Type ¶
func (StatsEvent) Type() observer.EventType
Type returns observer.EventStats to identify this as a statistics event.