MCPcopy Create free account
hub / github.com/PasarGuard/node / getInterfaceCounters

Method getInterfaceCounters

backend/wireguard/stats.go:16–26  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

14const onlineActivityThreshold = 45 * time.Second
15
16func (wg *WireGuard) getInterfaceCounters() (int64, int64, error) {
17 wg.mu.RLock()
18 mgr := wg.manager
19 wg.mu.RUnlock()
20
21 if mgr == nil {
22 return 0, 0, errWireGuardManagerNotInitialized
23 }
24
25 return mgr.GetInterfaceStats()
26}
27
28func (wg *WireGuard) handleUserStats(ctx context.Context, request *common.StatRequest) (*common.StatResponse, error) {
29 var keys []string

Callers 1

Calls 1

GetInterfaceStatsMethod · 0.80

Tested by

no test coverage detected