mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-12 05:37:32 +00:00
wgengine/netlog: new package for traffic flow logging (#5864)
The Logger type managers a logtail.Logger for extracting statistics from a tstun.Wrapper. So long as Shutdown is called, it ensures that logtail and statistic gathering resources are properly cleared up. Signed-off-by: Joe Tsai <joetsai@digital-static.net>
This commit is contained in:
@@ -844,7 +844,9 @@ func (t *Wrapper) Unwrap() tun.Device {
|
||||
}
|
||||
|
||||
// SetStatisticsEnabled enables per-connections packet counters.
|
||||
// ExtractStatistics must be called periodically to avoid unbounded memory use.
|
||||
// Disabling statistics gathering does not reset the counters.
|
||||
// ExtractStatistics must be called to reset the counters and
|
||||
// be periodically called while enabled to avoid unbounded memory use.
|
||||
func (t *Wrapper) SetStatisticsEnabled(enable bool) {
|
||||
t.stats.enabled.Store(enable)
|
||||
}
|
||||
|
Reference in New Issue
Block a user