MCPcopy Create free account
hub / github.com/Hidden-Node/GooseRelayVPN-AndroidClient / logStats

Method logStats

internal/carrier/stats.go:32–54  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

30}
31
32func (c *Client) logStats() {
33 c.mu.Lock()
34 active := len(c.sessions)
35 c.mu.Unlock()
36
37 healthy, total := c.endpointHealthCounts()
38 endpointDetail := c.endpointStatsLine()
39 accountSummary := c.accountStatsLine()
40
41 log.Printf("[stats] active=%d sessions=%d/%d frames=%d/%d bytes=%s/%s polls=%d/%d rst=%d endpoints=%d/%d",
42 active,
43 c.stats.sessionsOpen.Load(), c.stats.sessionsClose.Load(),
44 c.stats.framesOut.Load(), c.stats.framesIn.Load(),
45 humanBytes(c.stats.bytesOut.Load()), humanBytes(c.stats.bytesIn.Load()),
46 c.stats.pollsOK.Load(), c.stats.pollsFail.Load(),
47 c.stats.rstFromServer.Load(),
48 healthy, total,
49 )
50 log.Printf("[stats] endpoints: %s", endpointDetail)
51 if accountSummary != "" {
52 log.Printf("[stats] %s", strings.TrimSpace(accountSummary))
53 }
54}
55
56func (c *Client) endpointHealthCounts() (healthy, total int) {
57 c.endpointMu.Lock()

Callers 1

runStatsLoopMethod · 0.95

Calls 4

endpointHealthCountsMethod · 0.95
endpointStatsLineMethod · 0.95
accountStatsLineMethod · 0.95
humanBytesFunction · 0.70

Tested by

no test coverage detected